如何运行此gradle任务/将其包含在构建任务(https://github.com/prashant-ramcharan/courgette-jvm)
中task regressionSuite(type: Test, dependsOn: testClasses) {
systemProperty('name', 'value')
include '**/RegressionTestSuite.class'
outputs.upToDateWhen { false }
}
当我做gradle clean regressionSuite
总是给我构建成功..但它没有执行指定的类。特定文件位于路径中。
我刚开始学习..任何帮助都非常赞赏!!
答案 0 :(得分:1)
您还需要配置测试任务的testClassesDir
和classpath
属性,否则无法找到您在模式中定义的类,也无法执行测试:
task regressionSuite(type: Test) {
systemProperty('name', 'value')
include '**/RegressionTestSuite.class'
outputs.upToDateWhen { false }
classpath = sourceSets.test.runtimeClasspath
testClassesDir = sourceSets.test.output.classesDir
}