我已经为我的项目中的功能测试设置了一个源集。一切都按预期工作,除了生成 junit 测试报告。我看不到我缺少什么配置位。这是我所拥有的:
sourceSets {
// Note that just declaring this sourceset creates two configurations.
funcTest {
scala {
srcDir 'src/funcTest/scala'
compileClasspath += main.output
runtimeClasspath += main.output
}
}
}
configurations {
funcTestCompile.extendsFrom testCompile
funcTestRuntime.extendsFrom testRuntime
}
task funcTest(type:Test){
description = "Run integration tests (located in src/funcTest/...)."
testClassesDir = project.sourceSets.funcTest.output.classesDir
testSrcDirs = project.sourceSets.funcTest.scala.source
classpath = project.sourceSets.funcTest.runtimeClasspath
dependsOn test
}
以上构建并运行我的测试。但是,报告目录结构如下所示:
./build/reports/tests/No source file found at src/test/scala/com/hp/snapfish/ecommerce/taxservice/mongo/base-style.css
./build/reports/tests/No source file found at src/test/scala/com/hp/snapfish/ecommerce/taxservice/mongo/css3-pie-1.0beta3.htc
./build/reports/tests/No source file found at src/test/scala/com/hp/snapfish/ecommerce/taxservice/mongo/MongoConfigTest.html
./build/reports/tests/No source file found at src/test/scala/com/hp/snapfish/ecommerce/taxservice/mongo/MongoConfigTest.scala.html
./build/reports/tests/No source file found at src/test/scala/com/hp/snapfish/ecommerce/taxservice/mongo/report.js
./build/reports/tests/No source file found at src/test/scala/com/hp/snapfish/ecommerce/taxservice/mongo/style.css
我错过了什么?为什么要创造那个
在 src 找不到源文件
目录?我认为它需要知道它应该在寻找 scala 文件,但我不知道如何告诉它。我一定遗漏了一些明显的东西。