Jeff,
You might be able to do this natively within ant

This is how it could work for a single file:
<target name="test-failure-check">
  <local name="error.found"/>
  <loadfile property="error.found"
srcfile="${home.dir}/runtime/logs/test-results/file.xml">
<filterchain>
<linecontainsregexp>
<regexp pattern="failure"/>
</linecontainsregexp>
</filterchain>
  </loadfile>
  <fail message="Unit test failure(s)" unless="error.found"/>
</target>

Doing this this with *.xml is left as an exercise for the reader :-)

Harold

On Wed, Aug 15, 2012 at 6:56 PM, Jeff Lowery <jef...@mavericklabel.com>wrote:

> Have the following target:
>
> <target name="test-failure-check">
>                 <exec executable="grep">
>                         <arg line="failure
> ${home.dir}/runtime/logs/test-results/*.xml" />
>                         <redirector outputproperty="grep.out" />
>                 </exec>
>                 <echo message="grep.out='${grep.out}'" />
>
>                 <fail message="Unit test failure(s)">
>                         <condition>
>                                 <not>
>                                         <equals arg1="${grep.out}" arg2=""
> />
>                                 </not>
>                         </condition>
>                 </fail>
> </target>
>
> and getting the following echo:
>
> [echo] grep.out='grep:
> /Users/jeff.l/Documents/workspace/homedir/runtime/logs/test-results/*.xml:
> No such file or directory'
>
> yet if I execute "grep failure
> /Users/jeff.l/Documents/workspace/homedir/runtime/logs/test-results/*.xml",
> from the command line, I get results back.
>
>
> -- Jeff
>
>
>
>


-- 
Harold PUTMAN
Web Technology Specialist
*Lexmark International, Inc. <http://www.lexmark.com>*
740 W New Circle Rd.
Lexington, KY 40550
+1(859) 232-2839
hput...@lexmark.com

Reply via email to