<fail/> ?
-----Original Message-----
From: Neal Myerson [mailto:[EMAIL PROTECTED]]
Sent: 09 May 2002 19:47
To: [EMAIL PROTECTED]
Subject: How do I force ant to fail?
Summary: I'm trying to write some checkin tests using Ant. They use
jdk14, so I do a simple recusion to make sure JAVA_HOME is set properly.
if="jdk1.4", I then run the tests with a simple:
<java classname="jbtest.JBTestRunner" fork="yes" failonerror="true">
.... </java>
Works great. When the tests fail, I get a BUILD FAILED from Ant, just
like I want!
Except... to set jdk1.4 I had called:
<exec executable="${antexec}" dir="." failonerror="true">
<env key="JAVA_HOME" value="../build/jdk1.4"/>
<arg value="${targetName}"/>
</exec>
And this I cannot get to fail. So even when the nested Ant script fails,
this one still succeeds, even though I have a failonerror set. I assume
it's because the exec actually does succeed, it's just the ant script
that was called from it that failed.
Does this make sense? How can I get the outer Ant script to fail. Or
more to the point, when my tests fail I want total system failure. I
want it to say BUILD FAILED and just stop.
Any ideas?
Thanks
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 19/04/2002
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>