我已經在我的項目中設置了功能測試的源代碼集。除了junit測試報告的生成之外,一切都按預期工作。我看不到我缺少什麼配置。這裏是我的:如何讓gradle爲自定義sourceset生成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文件,但我不知道如何告訴它。我必須失去一些明顯的東西。
'testLogging'隻影響控制檯輸出。 –
「testLogging」工作需要什麼插件?當使用android-test(junit)時,在build.gradle中使用此確切代碼時,我得到「找不到方法testLogging」。 – 2013-11-06 15:37:22