Thanks for the advice. Where should I use this line, should I perhaps create a different target like "check-results" and put that test in there and just call this new target at the end of my build?
What about properties being immutable? Since I am using failureproperty="tests.failed" in both targets can the second target Modify the property? Thanks again. Sean -----Original Message----- From: Gilles Scokart [mailto:[EMAIL PROTECTED] Sent: Monday, April 23, 2007 3:25 PM To: Ant Users List Subject: Re: Multiple junit tasks Use <fail if="tests.failed">Test failed</fail> 2007/4/23, Sean Tiley <[EMAIL PROTECTED]>: > Hi There, > I have 2 targets that run unit tests during the course of my build, > (JUnit tests pre deployment and HttpUnit tests post deployment). > > I would like for all tests in both targets to be executed regardless of > whether or not failures/errors occur. Then once both sets of tests are > run I would like to somehow tell if there were any test failures in > either suite to pass or fail the entire build. > > The way I currently have it, even if there are failures, my build > succeeds. > > I think the secret lies within the proper use of the "failureproperty" > but I am not clear on how this works. > > If anyone could be of assistance it would be greatly appreciated > > Sean > > > My targets appear as follows > > > <!-- This target runs the EJB JUNIT tests --> > <target name="test-ejb" description="Run the Junit test cases"> > <echo>Running the EJB test suite</echo> > <junit printsummary="withOutAndErr" > fork="true" haltonfailure="false" > failureproperty="tests.failed" > showoutput="true"> > <classpath> > <path refid="test-path" /> > </classpath> > <jvmarg value="-Xmx256M" /> > <formatter type="xml" /> > <test name="${ejb.test.class}" > outfile="${log.dir}/${ejb-test- results.file}" /> > </junit> > </target> > > <!-- This target runs the HttpUnit tests --> > <target name="httpunit-test"> > <echo>Running the HttpUnit test suite</echo> > <junit printsummary="withOutAndErr" > fork="true" haltonfailure="false" > failureproperty="tests.failed" > showoutput="true"> > <classpath> > <path refid="test-path" /> > </classpath> > <jvmarg value="-Xmx512M" /> > <formatter type="xml" /> > <test name="${httpunit.test.class}" > outfile="${log.dir}/${httpunit-test- results.file}" /> > </junit> > </target> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Gilles SCOKART --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]