Added a build target "unittest-no-junit-report" to run unit tests and

not create a junit report, but instead to show test run results in
the ant output stream. Modified .travis.yml to use
unittest-no-junit-report instead of unittest, and to change directory
to core before doing the build and unittest.
This commit is contained in:
soupwizard 2013-04-24 18:22:27 -07:00
parent 38cb932331
commit 1cfdbf7e3f
2 changed files with 34 additions and 2 deletions

View File

@ -2,5 +2,6 @@ language: java
jdk:
- oraclejdk7
script:
- "ant -buildfile core/build.xml clean checkascii build jar"
- "ant -buildfile core/build.xml unittest"
- "cd core"
- "ant -buildfile build.xml clean checkascii build jar"
- "ant -buildfile build.xml unittest-no-junit-report"

View File

@ -299,5 +299,36 @@ ${nonascii}</fail>
Unit tests passed successfully.
</echo>
</target>
<!-- Unit test (show errors in output stream instead of junit report) -->
<target name="unittest-no-junit-report" description="Execute unit tests, show report to output stream" depends="build">
<echo>Building unit tests</echo>
<mkdir dir="${build-test.dir}"/>
<javac debug="true" srcdir="${src-test.dir}" destdir="${build-test.dir}" classpathref="test-classpath"/>
<echo>Running unit tests</echo>
<mkdir dir="${tmp.dir}/rawtestoutput"/>
<junit fork="yes" forkmode="once" printsummary="false" failureproperty="junit.failure">
<classpath>
<path refid="test-classpath"/>
<path location="${basedir}"/>
</classpath>
<batchtest todir="${tmp.dir}/rawtestoutput">
<fileset dir="${build-test.dir}">
<include name="**/Test*.class" />
<include name="**/*Test.class" />
<exclude name="**/*$*.class" />
<exclude name="Test.class" />
</fileset>
<!-- <formatter type="xml"/> -->
<formatter type="plain" usefile="false" />
</batchtest>
</junit>
<fail if="junit.failure" message="Unit test(s) failed. See output above for failures."/>
<echo>
Unit tests passed successfully.
</echo>
</target>
</project>