n4r*_*zul 15 automated-tests build gradle
我的项目结构如下所示.我想在Gradle中使用TestReport功能将所有测试结果聚合到一个目录中.然后,我可以通过单个index.html文件访问所有子项目的所有测试结果.我怎么能做到这一点?
.
|--ProjectA
|--src/test/...
|--build
|--reports
|--tests
|--index.html (testresults)
|--..
|--..
|--ProjectB
|--src/test/...
|--build
|--reports
|--tests
|--index.html (testresults)
|--..
|--..
Run Code Online (Sandbox Code Playgroud)
Pet*_*ser 29
来自例23.13.在Gradle用户指南中为子项目创建单元测试报告:
subprojects {
apply plugin: 'java'
// Disable the test report for the individual test task
test {
reports.html.enabled = false
}
}
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allTests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
}
Run Code Online (Sandbox Code Playgroud)
完全工作的样品可从samples/testing/testReport
完整的Gradle分布中获得.
归档时间: |
|
查看次数: |
9854 次 |
最近记录: |