0

i've renamed my test folder to "test". Before it was set to AndroidTest and everything works. But i have a task from my superior that the test folder must be called "test". After i renamed the folder to test in android studio the test stopped running so i went into the run configuration for the test and specified teh package name but that did not help. Here are some details on issue:

enter image description here

and here is the build configuration i am running for the test:

enter image description here

The manifest does not have anything about test in it. This is just a dummy project i made. Do i need to enter something in the manifest ?

j2emanue
  • 60,549
  • 65
  • 286
  • 456

1 Answers1

0

After reading the article provided in the comments i thought i'd share how one might resolved the issue:

Android studio does not know how to respond to our test runner unless we tell it. so i made a gradle task like the following:

enter image description here

when you run this gradle task it will run all test cases.

To explain, here we will cleanTest (which cleans all previous tests) then we will run the test task (its like doing gradle test on command line to run test). The test dont run again if they are successful so if you give it the option of --rerun-tasks then it will return the same test task. As for the --tests * option its used to specify which tests you want to run. in my case it was everything but you can specify a class path or even down to the method level here. very useful. so its like running this on the command line: gradle test --rerun-tasks

j2emanue
  • 60,549
  • 65
  • 286
  • 456