Skip to content

Commit

Permalink
Report test status via a separate target.
Browse files Browse the repository at this point in the history
This allows the status to be regenerated from the logs directory as
required.
  • Loading branch information
markt-asf committed Jun 3, 2019
1 parent 4f807ee commit 65438df
Showing 1 changed file with 5 additions and 34 deletions.
39 changes: 5 additions & 34 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1474,42 +1474,13 @@
<property name="junit.formatter.extension" value=".txt" />

<target name="test" description="Runs the JUnit test cases"
depends="test-nio,test-nio2,test-apr,cobertura-report" >
<fileset id="test.result.skippedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Skipped: 0" />
</not>
</fileset>
<fileset id="test.result.failedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Failures: 0, Errors: 0" />
</not>
</fileset>
<concat>
<header>Testsuites with skipped tests:${line.separator}</header>
<string>${toString:test.result.skippedtests}</string>
<filterchain>
<tokenfilter delimOutput="${line.separator}">
<stringtokenizer delims=";"/>
</tokenfilter>
</filterchain>
</concat>
<concat>
<header>Testsuites with failed tests:${line.separator}</header>
<string>${toString:test.result.failedtests}</string>
<filterchain>
<tokenfilter delimOutput="${line.separator}">
<stringtokenizer delims=";"/>
</tokenfilter>
</filterchain>
</concat>

<fail if="test.result.error" message='Some tests completed with an Error. See ${tomcat.build}/logs for details, search for "ERROR".' />
<fail if="test.result.failure" message='Some tests completed with a Failure. See ${tomcat.build}/logs for details, search for "FAILED".' />
</target>
depends="test-nio,test-nio2,test-apr,cobertura-report,test-status" />

<target name="test-only" description="Runs the JUnit test cases without additional processing"
depends="test-only-nio,test-only-nio2,test-only-apr" >
depends="test-only-nio,test-only-nio2,test-only-apr,test-status" />

<target name="test-status"
description="Analyses logs directory and reports on skipped tests, test failures and test errors">
<fileset id="test.result.skippedtests" dir="${test.reports}" includes="*.txt">
<not>
<contains text="Skipped: 0" />
Expand Down

0 comments on commit 65438df

Please sign in to comment.