Skip to content

Apache Lucene open-source search software

SOLR-1441 -- Make it possible to run all tests in a package

Shalin Shekhar Mangar8817e583c77e
diff --git a/CHANGES.txt b/CHANGES.txt
index be2e9ad78a7..ba587d63e14 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -704,6 +704,8 @@ Build
5. SOLR-1386: In build.xml, use longfile="gnu" in tar task to avoid warnings about long file names
(Mark Miller via shalin)
+
+ 6. SOLR-1441: Make it possible to run all tests in a package (shalin)
Documentation
diff --git a/build.xml b/build.xml
index 854eeff7382..ec4a01741e2 100644
--- a/build.xml
+++ b/build.xml
@@ -368,7 +368,15 @@
<!-- no description so it doesn't show up in -projecthelp -->
<mkdir dir="${junit.output.dir}"/>
-
+ <condition property="runall">
+ <not>
+ <or>
+ <isset property="testcase"/>
+ <isset property="testpackage"/>
+ <isset property="testpackageroot"/>
+ </or>
+ </not>
+ </condition>
<junit printsummary="on"
haltonfailure="no"
errorProperty="tests.failed"
@@ -379,9 +387,15 @@
<formatter type="brief" usefile="false" if="junit.details"/>
<classpath refid="test.run.classpath"/>
<formatter type="xml"/>
- <batchtest fork="yes" todir="${junit.output.dir}" unless="testcase">
+ <batchtest fork="yes" todir="${junit.output.dir}" if="runall">
<fileset dir="src/test" includes="${junit.includes}"/>
</batchtest>
+ <batchtest fork="yes" todir="${junit.output.dir}" if="testpackage">
+ <fileset dir="src/test" includes="**/${testpackage}/**/Test*.java,**/${testpackage}/**/*Test.java"/>
+ </batchtest>
+ <batchtest fork="yes" todir="${junit.output.dir}" if="testpackageroot">
+ <fileset dir="src/test" includes="**/${testpackageroot}/Test*.java,**/${testpackageroot}/*Test.java"/>
+ </batchtest>
<batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
<fileset dir="src/test" includes="**/${testcase}.java"/>
</batchtest>