Index: contrib/contrib-build.xml
===================================================================
--- contrib/contrib-build.xml	(revision 539609)
+++ contrib/contrib-build.xml	(working copy)
@@ -18,6 +18,7 @@
 
   <path id="test.classpath">
     <path refid="classpath"/>
+    <pathelement location="../../build/classes/test/"/>
     <pathelement location="${junit.jar}"/>
     <pathelement location="${build.dir}/classes/java"/>
   </path>
Index: contrib/xml-query-parser/build.xml
===================================================================
--- contrib/xml-query-parser/build.xml	(revision 539609)
+++ contrib/xml-query-parser/build.xml	(working copy)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<project name="xml-query-parser" default="buildParser">
+<project name="xml-query-parser" default="default">
 
   <description>
     XML query parser
@@ -8,7 +8,8 @@
 
   <import file="../contrib-build.xml"/>
 
-  <property name="queries.jar" location="../../build/contrib/queries/lucene-queries-${version}.jar"/>
+  <property name="queries.jar" location="${common.dir}/build/contrib/queries/lucene-queries-${version}.jar"/>
+  <available property="queries.jar.present" type="file" file="${queries.jar}"/>
 
   <path id="classpath">
    <pathelement path="${lucene.jar}"/>
@@ -17,9 +18,9 @@
   </path>
 
 
-  <target name="buildParser" depends="buildQueries,default" />
+  <target name="compile-core" depends="build-queries, common.compile-core" />
 
-  <target name="buildQueries" >
+  <target name="build-queries" unless="queries.jar.present">
   	  <echo>XML Parser building dependency ${queries.jar}</echo>
       <ant antfile="../queries/build.xml" target="default" inheritall="false"/>
   </target>
Index: contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
===================================================================
--- contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java	(revision 539609)
+++ contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java	(working copy)
@@ -209,7 +209,12 @@
     new MemoryIndexTest().run(args);    
   }
 
-//  public void setUp() {  }
+  /* all files will be open relative to this */
+  public String fileDir;
+  public void setUp() {
+    fileDir = System.getProperty("contrib.memory.docdir", null);
+  }
+  
 //  public void tearDown() {}
   
   public void testMany() throws Throwable {
@@ -247,7 +252,7 @@
     if (args.length > ++k) {
       String arg = args[k];
       if (arg.startsWith("@")) 
-        queries = readLines(new File(arg.substring(1)));
+        queries = readLines(new File(fileDir, arg.substring(1)));
       else
         queries = new String[] { arg };
     }
@@ -522,4 +527,4 @@
     }
   }
   
-}
\ No newline at end of file
+}
Index: common-build.xml
===================================================================
--- common-build.xml	(revision 539609)
+++ common-build.xml	(working copy)
@@ -190,6 +190,10 @@
       <sysproperty key="tempDir" file="${build.dir}/test"/>
       <sysproperty key="java.io.tmpdir" file="${build.dir}/test"/>
 
+      <!-- contrib/memory, set this way so test works from anywhere -->
+      <sysproperty key="contrib.memory.docdir"
+                   file="${common.dir}/contrib/memory/" />
+      
       <!-- contrib/ant IndexTaskTest needs these two system properties -->
       <sysproperty key="docs.dir" file="src/test"/>
       <sysproperty key="index.dir" file="${build.dir}/test/index"/>
@@ -206,8 +210,13 @@
         <fileset dir="src/test" includes="**/${testcase}.java"/>
       </batchtest>
     </junit>
-
+    <!-- create this file, then if we don't fail, delete it -->
+    <!-- this meme makes it easy to tell if contribs have failed later -->
+    <echo file="${build.dir}/test/junitfailed.flag">MAYBE</echo>
     <fail if="tests.failed">Tests failed!</fail>
+    <!-- life would be easier if echo had an 'if' attribute like fail -->
+    <delete file="${build.dir}/test/junitfailed.flag" />
+    
   </target>
 
     <!--
@@ -255,8 +264,11 @@
   <target name="generate-test-reports" description="Generates test reports">
     <mkdir dir="${junit.reports}"/>
     <junitreport todir="${junit.output.dir}">
-      <fileset dir="${junit.output.dir}">
-        <include name="TEST-*.xml"/>
+      <!-- this fileset let's the task work for individual contribs,
+           as well as the project as a whole
+       -->
+      <fileset dir="${build.dir}">
+        <include name="**/test/TEST-*.xml"/>
       </fileset>
       <report format="frames" todir="${junit.reports}"/>
     </junitreport>
Index: build.xml
===================================================================
--- build.xml	(revision 539609)
+++ build.xml	(working copy)
@@ -71,6 +71,13 @@
     </rmic>
   </target>
 
+  <target name="test-core" depends="common.test"
+          description="Runs unit tests for the core Lucene code"
+  />
+  <target name="test" depends="test-core, test-contrib"
+          description="Runs all unit tests"
+  />
+  
   <!-- ================================================================== -->
   <!-- J A R                                                              -->
   <!-- ================================================================== -->
@@ -342,8 +349,9 @@
   
   <macrodef name="contrib-crawl">
     <attribute name="target" default=""/>
+    <attribute name="failonerror" default="true"/>
     <sequential>
-      <subant target="@{target}" failonerror="false">
+      <subant target="@{target}" failonerror="@{failonerror}">
         <fileset dir="."
                  includes="contrib/*/build.xml"
         />
@@ -356,7 +364,19 @@
   </target>
 
   <target name="test-contrib" depends="compile-test">
-    <contrib-crawl target="test"/>
+    <!-- don't fail on error, instead check for flag file so we run
+         all the tests possible and can "ant generate-test-reports"
+         for all of them
+     -->
+    <contrib-crawl target="test" failonerror="false"/>
+    <available property="contribs.failed" file="junitfailed.flag">
+      <filepath>
+        <dirset dir="${build.dir}/contrib/">
+          <include name="**/test/" />
+        </dirset>
+      </filepath>
+    </available>
+    <fail if="contribs.failed">Contrib tests failed!</fail>
   </target>
 
   <macrodef name="invoke-javadoc">
