You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Geoffrey Mitchell <ge...@homedecorators.com> on 2007/09/25 00:58:00 UTC

Re: "catching" test failure/error (or more generally failure within calls)

Use the "failureproperty" attribute of the junit task to set a property 
on failure.  How to propagate that back to your top level build is 
another question.  You could write out a file and check for it, I suppose.

Greg Irvine wrote:

>I would like to fail our build on junit test failure and still produce the
>junit report.
>
>Easy enough generally, however, our build runs somewhat similarly to make in
>that I have an ant properties file in each folder that describes the list of
>folders to build within that folder, and using common imported generic build
>files, it recurses through folders until it finds a project and does a build
>(<javac>, <jar>, <junit>, etc).
>Once all folders have been recursed through the top level build.xml produces
>the report.
>
>The problem I have is that because the <junit> call is done within each
>project (eventually, via a tree of nested <subant> calls) if I use the
>haltonfailure/haltonerror attributes of <junit> the build fails within the
>nested build file and never returns to the top level build file to produce
>the report.
>
>Any suggestions?
>
>
>Cheers.
>
>Greg
>
>
>Ps. The reason I've nested things like this is because there may be projects
>in the folder structure I don't want in the main build (for one reason or
>another), so I use the properties to specify which subfolders to build
>throughout the full structure.
>Perhaps if I shifted the lists of folders a single list/file at the top
>level I could remove the <subant> nesting and just have a top level file...
>hmm... any other suggestions welcome...
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>

-- 
Geoffrey Mitchell
Programmer/Analyst
Home Decorator's Collection
314-684-1062


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