Allow a specific test to be run with "ant -Dtest=Foo tests".

This commit is contained in:
Michael Bayne
2010-06-18 23:12:27 +00:00
parent 5e77d29c47
commit 6fd404587f
+3 -1
View File
@@ -130,6 +130,8 @@
<!-- runs our unit tests --> <!-- runs our unit tests -->
<target name="tests" depends="prepare,compile" description="Runs the unit tests."> <target name="tests" depends="prepare,compile" description="Runs the unit tests.">
<!-- allows passing -Dtest=NamePrefix to restrict to subset of tests -->
<property name="test" value=""/>
<taskdef name="unit" classpathref="classpath" <taskdef name="unit" classpathref="classpath"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<unit printsummary="off" haltonfailure="yes" fork="${junit.fork}"> <unit printsummary="off" haltonfailure="yes" fork="${junit.fork}">
@@ -142,7 +144,7 @@
<formatter type="brief" usefile="false"/> <formatter type="brief" usefile="false"/>
<batchtest> <batchtest>
<fileset dir="${src.dir}"> <fileset dir="${src.dir}">
<include name="**/tests/**/*Test.java"/> <include name="**/tests/**/${test}*Test.java"/>
<exclude name="com/samskivert/depot/EHCacheAdapter.java" unless="ehcache.present"/> <exclude name="com/samskivert/depot/EHCacheAdapter.java" unless="ehcache.present"/>
</fileset> </fileset>
</batchtest> </batchtest>