ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Carlson <>
Subject Junit and mail from ant
Date Sat, 25 Sep 2004 09:26:25 GMT
Hi, I would like to improve my overnight build and unit test process
which runs as an ant task on linux. It's a combination of linux batch
*.sh files which perform pre and post processing of the source, which
is also extracted by the *.sh batch from subversion to a fresh dir
each night. The bottom line is I know about being able to invoke JUnit
and <mail> from within ant but I'm constrained by these pre and post
processing tasks to such an extent that I can't, I am stuck with a
sequence similar to this:

(in sh)
extract tree to fresh dir (including build.xml) > build.log
extract test tree to fresh dir (including build.xml) > test.log
ant build.xml >> build log
java junit.jar junit.textui.TestRunner ... >> test.log
sendmail $to < build.log
sendmail $to < test.log

This works, but the email could be better. If the build fails, I want
to know about it in the subject (in fact I'd like the option to send
it in this event to more than 1 email address for cellphone altrts).
Also, I'd like to capture the last line from the ant task and put that
as a subject, so it would say "187/187 tests passed" for example. In
my scheme above I am too late in both instances, you can see the log
contains the source extract too which is important. I can either get
fancy with sh and post process the logs to create a subject or, ask
here if there is a way to capture just the output of the tasks in say
global vars. I could then use $testsinvoked/$testspassed as a subject
and $buildstatus for the build (that being boolean). 


-- ec

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message