Running a specific instrumentation unit test with Gradle

后端 未结 8 931
既然无缘
既然无缘 2020-11-30 04:27

Is there a way to run a specific Android instrumentation unit test using Gradle? I\'ve tried

gradle -Dtest.single=UnitTestName connectedInstrumentTest
         


        
8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 05:06

    The pattern is -D.single= so in your example it should be:

    gradle -DconnectedInstrumentTest.single=UnitTestName connectedInstrumentTest
    

    NOTE: This answer is outdated. You should use the --tests switch in the latest versions of Gradle. (see other answers for an explanation)

提交回复
热议问题