ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <stefan.bode...@freenet.de>
Subject Re: [junit] testing ant failure
Date Sat, 12 Nov 2005 17:38:43 GMT
On Fri, 11 Nov 2005, Thomas L. Roche <tlroche@us.ibm.com> wrote:

> What's the "best way" to test for appropriate failure? The only
> thing that comes to my mind is to parse the logfile, e.g.
> 
> * check for a "BUILD FAILED" line
> 
> * check that a line after the "BUILD FAILED" line contains the
>   appropriate failure message.
> 
> Is there an easier/better way?

Take a look at Ant's own unit tests.  There is a BuildFileTest base
class that many tests extend with helper methods like
expectSpecificBuildException() which assert an Ant build fails.

Another alternative, and Ant itself is probably heading to this, is
the newer AntUnit test framework/antlib, that can be found in Ant's
svn repository in the sandbox (which it probably is going to leave in
order to become a real Ant subproject rather soon).

Stefan

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


Mime
View raw message