通过自定义TestFramework增强Gradle的“测试”任务

时间:2019-02-11 08:21:59

标签: java unit-testing gradle gradle-plugin

现有的Test任务仅支持三个TestFramework实现:

如何添加对自定义测试框架的支持(很可能是通过 Gradle 插件)的-e。 g.:TAPDejaGnu-这样我的自定义单元测试就可以在test任务中执行?

更新:

天真的扩展org.gradle.api.tasks.testing.AbstractTestTask的方法在运行时导致以下失败( Gradle 5.1,应用了我的自定义插件):

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':test1'.
> No value has been specified for property 'binResultsDir'.
> No value has been specified for property 'reports.html.destination'.
> No value has been specified for property 'reports.junitXml.destination'.
> No value has been specified for property 'reports.enabledReports.html.destination'.
> No value has been specified for property 'reports.enabledReports.junitXml.destination'.

添加新的测试框架时,真的需要关心 HTML JUnit XML 报告吗?

0 个答案:

没有答案