[英]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.