Skip to content

Commit

Permalink
Merge pull request #240 from kcooney/ant-test
Browse files Browse the repository at this point in the history
Add test target to build.xml
  • Loading branch information
dsaff committed Jun 27, 2011
2 parents ed2b51b + d933218 commit 8ddf4be
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions build.xml
Expand Up @@ -173,7 +173,8 @@
<copy file="build.xml" tofile="${dist}/build.xml" />
</target>

<macrodef name="run-tests">
<macrodef name="run-dist-tests">
<!-- Runs the tests against the built jar files -->
<element name="extra-args" implicit="yes" />
<sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
Expand All @@ -187,16 +188,36 @@
</sequential>
</macrodef>

<target name="dist" depends="populate-dist">
<run-tests>
<macrodef name="run-local-tests">
<!-- Runs the tests against the local class files -->
<sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
<arg value="org.junit.tests.AllTests"/>
<classpath>
<pathelement location="${bin}" />
<pathelement location="${testbin}" />
<pathelement location="${hamcrestlib}" />
</classpath>
</java>
</sequential>
</macrodef>

<target name="test" depends="build">
<run-local-tests />
</target>

<target name="test-jars" depends="populate-dist">
<run-dist-tests>
<jvmarg value="-Dignore.this=ignored" />
</run-tests>
</run-dist-tests>
</target>

<target name="dist" depends="test-jars" />

<target name="profile" depends="populate-dist">
<run-tests>
<run-dist-tests>
<jvmarg value="-agentlib:hprof=cpu=samples"/>
</run-tests>
</run-dist-tests>
</target>

<target name="zip" depends="dist">
Expand Down

0 comments on commit 8ddf4be

Please sign in to comment.