I run <junit> with failonerror off (which it is by default) so that all
tests run, and then <fail> after they run in this manner:
<junit printsummary="no"
errorProperty="test.failed"
failureProperty="test.failed"
fork="${junit.fork}">
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<batchtest todir="${test.dir}/data" if="testcase">
<fileset dir="${test.dir}/${module}/classes"
includes="**/${testcase}.class"
/>
</batchtest>
<batchtest todir="${test.dir}/data" unless="testcase">
<fileset dir="${test.dir}/${module}/classes"
includes="**/*Test.class"
/>
</batchtest>
</junit>
<fail if="test.failed">Unit tests failed.</fail>
But this could be extended to run other tasks/tests before failing as
well, such as <junitreport>.
Erik
Alexey Solofnenko wrote:
> It is useful when you want to see all build problems. If build takes a lot
> of time to complete "keep-going" feature becomes essential. The simple
> example is unit testing. It is preferable to run as many unit tests as
> possible, but if some core unit test fails, there is no reason to continue.
> For example:
> "core-unit-test"
> "component1-unit-test"
> "component2-unit-test"
>
> Currently the first unit test fails, the whole build will terminate.
>
> - Alexey.
> --
> { http://trelony.cjb.net/ } Alexey N. Solofnenko
> { http://www.inventigo.com/ } Inventigo LLC
> Pleasant Hill, CA (GMT-8 usually)
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>