假设我想将 Robolectric 测试与普通单元测试分开,并将它们作为单独的 gradle 任务运行。是否可以?
我已经设法从单元测试中排除不需要的测试:
android {
...
testOptions {
unitTests.all {
exclude 'package/with/robolectric/tests/**'
}
}
}
但现在我不确定如何配置单独的测试任务,其中仅包括来自package/with/robolectric/tests/
包裹。
我发现了类似的问题,但答案不起作用:gradle 与 android 上的单独集成测试任务 https://stackoverflow.com/questions/26604917/separate-integration-test-task-on-gradle-with-android
改成
testOptions {
if (!project.hasProperty("INTEGRATIONTESTS")) {
unitTests.all {
exclude 'package/with/robolectric/tests/**'
}
}
}
并运行 Gradle-PINTEGRATIONTESTS=true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)