Issue
I would like to run a specific test fixture every time I build my Android application in Android Studio.
I've tried writing a custom task, and causing "preDebugBuild" to depend on my custom task. This doesn't work, and says that it fails to find dependencies.
My task body basically looks like this:
task runTests(type: Test){
}
I had hoped that this task would run all the tests in my project, and that I would then be able to put in some additional configuration to specify a single test, but I can't even get this task to run.
My questions are:
Is there something easy that I am missing to get my "runTests" task to actually work.
Is there some other way to run a specific unit test during the build preDebugBuild step of the Gradle build?
Thanks!
Solution
In the Run/Debug Configuration (click on "Edit Configuration" in the selector on the left side of the run button) you can select the "+" button on the bottom and select "Run Another Configuration" and a list of your unit tests should show up.
Answered By - user1892364