[英]How do I run PHPUnit 3.7 with Ant?
我正在使用PHPUnit 3.7并尝试使用Apache Ant自动构建(和测试)我的项目。 我已经阅读了PHPUnit的文档,但无法找到如何配置它以向Ant抛出错误。
我当前的Ant任务看起来像这样(测试文件在“tests”目录中):
<target name="test">
<echo message="Running unit tests with PHPUnit" />
<exec executable="phpunit" >
<arg value="tests/"/>
</exec>
</target>
我编写了一个简单的测试,它将失败并且ant测试任务显示[exec]中的失败,但构建标记为成功。
如何配置Ant任务,以便在测试失败时识别?
Aaaaaaa,这就是它的完成方式。 failonerror =“true”命令是我的朋友。
<target name="test">
<echo message="Running unit tests with PHPUnit" />
<exec executable="phpunit" failonerror="true">
<arg value="tests/"/>
</exec>
</target>
它现在有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.