jeudi 18 février 2016

How can I run a specific set of integration tests from the commandline using the com.android.application plugin and Gradle?

I am having difficulty with running specific tests from the commandline in my Android Studio project, which uses the com.android.application plugin (not the 'java' plugin) in Gradle.

I have the following tests:

  • TestA.java contains testA1, testA2, testA3
  • TestB.java contains testB1, testB2
  • TestC.java contains testC1, testC2, testC3, testC4

What I need is to run specific tests from the commandline. I know that I can run all of the tests by going

$ ./gradlew connected<Variant Name>AndroidTest

But I need to be able to, say, only run the tests in TestA and TestC.

I've seen a dozen posts on StackOverflow and website about using something like this:

$ ./gradlew test --tests <some filter>

But unless I apply the 'java' plugin (which is incompatiable with the 'com.android.application' plugin), there is no --tests flag in gradlew.

What am I missing?

Thank you kindly for your help!

Aucun commentaire:

Enregistrer un commentaire