Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #520 from kcooney/ant-test-rule

Add 'test' rule to build.xml
  • Loading branch information...
commit 32e64642722d15d7a1a1e271693d32a57a1efca5 2 parents 88c28a4 + 50bbb64
@dsaff dsaff authored
Showing with 25 additions and 6 deletions.
  1. +25 −6 build.xml
View
31 build.xml
@@ -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">
@@ -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">
Please sign in to comment.
Something went wrong with that request. Please try again.