I have the following code for grepping an xml file repo, in ant :
<echo message="Now checking xml test results for errors" />
<exec executable="grep" error="/dev/null">
<arg value="-r" />
<arg value="-m" />
<arg value="1" />
<arg value="-rl" />
<arg value="errors=\"[1-9]\"" />
<arg value="${reports.dir}" />
</exec>
<fail if="junit.failed" message="FAILING - unit tests failed." />
Im trying to replace :
<arg value="errors=\"[1-9]\"" />
with something along the lines of :
<arg value="errors|failures=\"[1-9]\"" />
So that both errors AND failures will be caught. How can I encode the grep correctly in my Ant XML to reflect this ? "**grep -r -m 1 -rl errors|failures=\"[1-9]\" ../reports/**" does not do the trick ( it results in a syntax issue, breaking the standard grep parser i guess )…
This is a guess, but you could try something along the lines of:
From
man grep: