I'll apply this patch tomorrow if you don't do it before hand. Looks good to me. I thought I had made the accommodation for *Test and Test* - I must have, but then ditched my changes for some reason as I'm certain I had made that change locally at one point.

    Erik

On May 11, 2005, at 2:06 PM, Doug Cutting wrote:

Attached is a patch to build.xml and common-build.xml that makes 'ant test' succeed. The problem is that, classically, unit tests in Lucene are named Test*.java, but there are tests in contrib named *Test.java, and there are non-unit tests in src/test named *Test.java. Until this is resolved, we need two patterns to identify unit tests, one for src/test and one for contrib/.

Doug
Index: build.xml
===================================================================
--- build.xml    (revision 169506)
+++ build.xml    (working copy)
@@ -2,6 +2,7 @@

 <project name="core" default="default" basedir=".">

+  <property name="junit.includes" value="**/Test*.java"/>

   <import file="common-build.xml"/>

@@ -393,6 +394,10 @@
     <contrib-crawl/>
   </target>

+  <target name="test-contrib" depends="compile-test">
+    <contrib-crawl target="test"/>
+  </target>
+
   <macrodef name="invoke-javadoc">
     <attribute name="access"/>
     <attribute name="destdir"/>
Index: common-build.xml
===================================================================
--- common-build.xml    (revision 169506)
+++ common-build.xml    (working copy)
@@ -41,8 +41,8 @@

<property name="junit.output.dir" location="${build.dir}/test"/>
<property name="junit.reports" location="${build.dir}/test/ reports"/>
+ <property name="junit.includes" value="**/Test*.java,**/ *Test.java"/>


-
<available
property="javacc.present"
classname="org.javacc.parser.Main"
@@ -178,8 +178,7 @@
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<batchtest fork="yes" todir="${junit.output.dir}" unless="testcase">
- <fileset dir="src/test" includes="**/Test*.java"/>
- <fileset dir="src/test" includes="**/*Test.java"/>
+ <fileset dir="src/test" includes="${junit.includes}"/>
</batchtest>
<batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
<fileset dir="src/test" includes="**/${testcase}.java"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to