ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: if task
Date Thu, 28 Feb 2002 08:04:39 GMT
On Wed, 27 Feb 2002, Rubun Tang <rtang@algorithmics.com> wrote:
> Sorry for not making myself clear, this is the pseudocode of what I
> want to do:
> 
> <target name="test">
> 
> 	<junit.....>
> 	<if ${final.test.result.failed}="true">
> 		<fail message="test failed"/>
> 	</if>
> </target>

Ant 1.4:

<target name="run.test">
  <junit ... >
  <condition property="test.failed">
    <equals arg1="true" arg2="${final.test.result.failed}" />
  </condition>
</target>

<target name="test" if="test.failed" depends="run.test">
  <fail message="test failed"/>
</target>

Ant 1.5alpha:

<target name="test">
  <junit ... >
  <condition property="test.failed">
    <equals arg1="true" arg2="${final.test.result.failed}" />
  </condition>
  <fail message="test failed" if="test.failed" />
</target>

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message