1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="IsFailureTest" default="main">
<target name="testFailureAfterNonExistingCommand">
<exec executable="iwggfchwbwejhdeuu" returnProperty="return.code"/>
<if>
<isfailure code="${return.code}"/>
<then>
<echo msg="Command failed with return code ${return.code}"/>
</then>
</if>
</target>
<target name="testNoFailureWithZeroValue">
<property name="return.code" value="0"/>
<if>
<isfailure code="${return.code}"/>
<then>
<echo msg="Command failed with return code ${return.code}"/>
</then>
</if>
</target>
<target name="main"/>
</project>
|