testing - 使用多个 `--tests`

标签 testing gradle kotlin

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/

相关文章:

android - 是否可以在不安装Android Studio和Android SDK的情况下构建Android Studio项目?

java - 如何在baseUrl中调用没有反斜杠的改造

android - 缺少主调度程序的模块

Python mocking-理解概念和必要性

安卓-Gradle : Copy to native-libs

java - com.google.android.material :material:1. 1.0-alpha08 失败但 1.0.0 工作正常

Android Kotlin 检测测试是否在调用 finish() 开始另一个 Activity 后结束/完成一个 Activity

功能测试结果的 bash 命令分组

visual-studio - 没有发现要运行的测试 - 在调试/运行单元测试用例时 - Visual Studio 2017 15.5.1

testing - 针对不同类型产品的测试自动化框架