繁体   English   中英

通过检查junit报告来使ant build失败?

[英]Fail ant build by checking junit report?

我需要仅根据junit报告导致构建失败。 有没有办法做到这一点。 我知道如何在junit标记中使用haltonfailure使构建失败,但在我的build.xml中,我只能访问junit报告。 我在用蚂蚁。

尝试类似的东西

    <fail if="testFail" message="At least one unit test failed"/>

在你的单元测试目标中。

请参阅: http//ant.apache.org/manual/Tasks/junit.html

尝试在junit ant任务中使用failureproperty="failed.unit.test.property"并检查它是否在运行完成时设置并失败:

<fail if="failed.unit.test.property" message="Unit tests failed with more custom msg to your test class/suite"/>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM