用gradle运行特定的单元测试 [英] Running a specific unit test with gradle
问题描述
gradle -Dtest.single = UnitTestName connectedInstrumentTest
但它似乎运行包中的所有测试。
预先感谢,
Ivan。
模式是 注意:此答案已过时。您应该在最新版本的Gradle中使用 Is there a way to run a specific Android unit test using Gradle? I've tried but it seems to run all the tests in the package. Thanks in advance,
Ivan. The pattern is
NOTE: This answer is outdated. You should use the
这篇关于用gradle运行特定的单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! -D< testTaskName> .single =< TestClass> code>在你的例子中它应该是:
$ b $ pre $ gradle -DconnectedInstrumentTest.single = UnitTestName connectedInstrumentTest
- tests
开关。 (请参阅其他解释)
gradle -Dtest.single=UnitTestName connectedInstrumentTest
-D<testTaskName>.single=<TestClass>
so in your example it should be:gradle -DconnectedInstrumentTest.single=UnitTestName connectedInstrumentTest
--tests
switch in the latest versions of Gradle. (see other answers for an explanation)