Skip to content

Commit

Permalink
Merge pull request junit-team#520 from kcooney/ant-test-rule
Browse files Browse the repository at this point in the history
Add 'test' rule to build.xml
  • Loading branch information
David Saff committed Oct 16, 2012
2 parents 88c28a4 + 50bbb64 commit 32e6464
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,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 @@ -188,16 +189,34 @@
</sequential>
</macrodef>

<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="dist" depends="populate-dist">
<run-tests>
<jvmarg value="-Dignore.this=ignored" />
</run-tests>
<run-dist-tests>
<jvmarg value="-Dignore.this=ignored"/>
</run-dist-tests>
</target>

<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 32e6464

Please sign in to comment.