phpUnderControl和PHPUnit总是使用代码255进行构建失败
发布时间:2020-12-13 21:37:54 所属栏目:PHP教程 来源:网络整理
导读:我在phpUnderControl中设置了以下build.xml文件. target name="phpunit" exec executable="phpunit" dir="${basedir}/httpdocs" failonerror="on" arg line="--log-junit ${basedir}/build/logs/phpunit.xml --coverage-clover ${basedir}/build/logs/phpuni
我在phpUnderControl中设置了以下build.xml文件.
<target name="phpunit"> <exec executable="phpunit" dir="${basedir}/httpdocs" failonerror="on"> <arg line="--log-junit ${basedir}/build/logs/phpunit.xml --coverage-clover ${basedir}/build/logs/phpunit.coverage.xml --coverage-html ${basedir}/build/coverage --colors ${basedir}/httpdocs/qc/unit/CalculatorTest.php" /> </exec> </target> 出于某些未知原因,构建总是失败并显示以下消息. phpunit: [exec] PHPUnit 3.4.15 by Sebastian Bergmann. [exec] BUILD FAILED /opt/cruisecontrol-bin-2.8.3/projects/citest.local/build.xml:30: exec returned: 255 我在单元目录中手动运行非常简单的单元测试,PHPUnit返回. PHPUnit 3.4.15 by Sebastian Bergmann. . Time: 0 seconds,Memory: 5.25Mb OK (1 test,1 assertion) 当所有测试都没问题时,有谁知道它为什么一直失败? 我的构建脚本确实有一个删除和记录文件的干净方法,所以不是这样.我还手动删除了日志文件,以防它是该脚本.并更改了日志目录的所有者,以便它们可写. 如果它有任何不同,运行PHPUnit后phpunit.xml为空. 谢谢. 更新:顺便说一句,如果我删除failonerror =“on”它显然有效,但PHPUnit仍然返回255,我确实希望它在任何错误上失败,问题是没有任何错误但它仍然失败! 解决方法
255是PHP抛出致命错误代码(我认为)解析错误.
可能在测试运行后,脚本执行中是否存在致命错误或解析错误? 任何PHP错误?如果添加error_reporting(E_ALL)会发生什么? ? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |