如何让 Gradle 构建生成 HTML 测试报告而不是默认的 XML? [英] How to make Gradle build produce HTML test report instead of XML default?
本文介绍了如何让 Gradle 构建生成 HTML 测试报告而不是默认的 XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前我通过运行 gradle clean build
来构建我的 Gradle 应用程序.这将练习 JUnit 测试并在 build/test-results
下的我的项目中生成 XML 测试结果.我想配置我的 build.gradle
文件以生成 HTML 测试结果(而不是 XML 默认值).这是可能的,如果是,如何?
Currently I build my Gradle app by running gradle clean build
. This exercises JUnit tests and produces XML test results in my project under build/test-results
. I would like to configure my build.gradle
file to produce HTML test results (instead of the XML default). Is this possible, if so, how?
推荐答案
test {
reports {
junitXml.enabled = false
html.enabled = true
}
}
要自己解决这个问题,请从 Test 开始">Gradle Build Language Reference,然后深入到(类型)reports
.
To figure this out on your own, start from Test
in the Gradle Build Language Reference, then drill down into (the type for) reports
.
这篇关于如何让 Gradle 构建生成 HTML 测试报告而不是默认的 XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文