在building the Kotlin compiler之后(在提交e80a01a处):
./gradlew dist
测试未成功通过:
./gradlew compiler:test
由于很少有测试用例失败,因此我想再次执行它们,但不会成功。只要我使用
--tests
选项在每次失败的测试中手动启动一次gradle,就有可能。例如,两个命令都生成一个失败的测试:./gradlew compiler:test --tests org.jetbrains.kotlin.code.CodeConformanceTest
./gradlew compiler:test --tests org.jetbrains.kotlin.codegen.ir.IrBlackBoxCodegenTestGenerated\$Functions\$BigArity
但是,如果我尝试多次使用
--tests
,则如果不运行测试,它将失败并显示错误:./gradlew compiler:test \
--tests org.jetbrains.kotlin.code.CodeConformanceTest \
--tests org.jetbrains.kotlin.codegen.ir.IrBlackBoxCodegenTestGenerated\$Functions\$BigArity
据我了解,Gradle文档似乎多次使用
--tests
选项说明了情况(请参阅“Testing in Java & JVM projects”):It is also possible to supply multiple
--tests
options, all of whose patterns will take effect.
我希望这不是Kotlin的问题。在我看来,这似乎是Gradle的问题,或者是我对Gradle的理解引起的问题(更有可能)。有什么意见吗?
最佳答案
这只是部分答案。我可以通过用通配符替换测试类程序包名称来解决此问题。这产生了与两次调用gradle相同的测试失败:
./gradlew compiler:test \
--tests \*.CodeConformanceTest \
--tests \*.IrBlackBoxCodegenTestGenerated\$Functions\$BigArity
我仍然不明白发生了什么。
关于testing - 使用多个 `--tests`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52206053/