You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2012/09/28 12:12:50 UTC

svn commit: r1391382 - in /lucene/dev/trunk: lucene/build.xml lucene/common-build.xml lucene/test-framework/build.xml solr/build.xml solr/test-framework/build.xml

Author: uschindler
Date: Fri Sep 28 10:12:49 2012
New Revision: 1391382

URL: http://svn.apache.org/viewvc?rev=1391382&view=rev
Log:
LUCENE-4445: Fix clover to correcty instrument all packages, improve permgen

Modified:
    lucene/dev/trunk/lucene/build.xml
    lucene/dev/trunk/lucene/common-build.xml
    lucene/dev/trunk/lucene/test-framework/build.xml
    lucene/dev/trunk/solr/build.xml
    lucene/dev/trunk/solr/test-framework/build.xml

Modified: lucene/dev/trunk/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/build.xml?rev=1391382&r1=1391381&r2=1391382&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/build.xml (original)
+++ lucene/dev/trunk/lucene/build.xml Fri Sep 28 10:12:49 2012
@@ -51,7 +51,8 @@
     </ant>
   </target>
 
-  <target name="test" depends="test-core, test-modules, test-backwards"
+  <!-- "-clover.load" is *not* a useless dependency. do not remove -->
+  <target name="test" depends="-clover.load, test-core, test-modules, test-backwards"
           description="Runs all unit tests (core, modules and back-compat)"
   />
 

Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1391382&r1=1391381&r2=1391382&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Fri Sep 28 10:12:49 2012
@@ -1138,7 +1138,7 @@ ${tests-output}/junit4-*.suites     - pe
 
   <!-- note: order here is important, the taskdef depends on test-framework
        jars so we just order it after compile-test to ensure that -->
-  <target name="test" depends="compile-test,install-junit4-taskdef,clover,validate" description="Runs unit tests">
+  <target name="test" depends="clover,compile-test,install-junit4-taskdef,validate" description="Runs unit tests">
     <mkdir dir="${junit.output.dir}"/>
     <test-macro threadNum="${tests.jvms}" />
   </target>
@@ -1146,9 +1146,9 @@ ${tests-output}/junit4-*.suites     - pe
   <!--
    See http://issues.apache.org/jira/browse/LUCENE-721
    -->
-  <target name="clover" depends="-clover.disable,-clover.setup" description="Instrument the Unit tests using Clover. To use, specify -Drun.clover=true on the command line."/>
+  <target name="clover" depends="-clover.disable,-clover.load,-clover.classpath,-clover.setup" description="Instrument the Unit tests using Clover. To use, specify -Drun.clover=true on the command line."/>
   
-  <target name="-clover.setup" if="run.clover" unless="clover.loaded">
+  <target name="-clover.load" if="run.clover" unless="clover.loaded">
     <available file="${clover.license.path}" property="clover.license.available" />
     <fail unless="clover.license.available"><![CDATA[.
 
@@ -1173,6 +1173,18 @@ ${tests-output}/junit4-*.suites     - pe
       inline="true" conf="master" type="jar" pathid="clover.classpath"/>
     <taskdef resource="cloverlib.xml" classpathref="clover.classpath" />
     <mkdir dir="${clover.db.dir}"/>
+    <!-- This is a hack, instead of setting "clover.loaded" to "true", we set it
+     to the stringified classpath. So it can be passed down to subants,
+     and reloaded by "-clover.classpath" task (see below): -->
+    <pathconvert property="clover.loaded" refid="clover.classpath"/>
+  </target>
+  
+  <target name="-clover.classpath" if="run.clover">
+    <!-- redefine the clover classpath refid for tests by using the hack above: -->
+    <path id="clover.classpath" path="${clover.loaded}"/>
+  </target>
+
+  <target name="-clover.setup" if="run.clover">
     <clover-setup initString="${clover.db.dir}/coverage.db" encoding="${build.encoding}">
       <fileset dir="${src.dir}" erroronmissingdir="no">
         <include name="org/apache/**/*.java" />
@@ -1181,7 +1193,6 @@ ${tests-output}/junit4-*.suites     - pe
         <include name="org/apache/**/*.java" />
       </testsources>
     </clover-setup>
-    <property name="clover.loaded" value="true"/>
   </target>
 
   <target name="-clover.disable" unless="run.clover">

Modified: lucene/dev/trunk/lucene/test-framework/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/build.xml?rev=1391382&r1=1391381&r2=1391382&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/build.xml (original)
+++ lucene/dev/trunk/lucene/test-framework/build.xml Fri Sep 28 10:12:49 2012
@@ -32,19 +32,13 @@
   </path>
 
   <!-- 
-      Specialize compile-core to depend on lucene-core compilation,
-      and *not* to depend on clover; clover already includes the
-      test-framework sources in each module's test instrumentation.
+      Specialize compile-core to depend on lucene-core and lucene-codecs compilation.
    -->
-  <target name="compile-core" depends="init,compile-lucene-core,compile-codecs"
-          description="Compiles test-framework classes">
-    <compile srcdir="${src.dir}" destdir="${build.dir}/classes/java">
-      <classpath refid="classpath"/>
-    </compile>
-    <copy todir="${build.dir}/classes/java">
-      <fileset dir="${src.dir}/../resources" erroronmissingdir="no"/>
-    </copy>
-  </target>
+  <target name="compile-core" depends="init,compile-lucene-core,compile-codecs,common.compile-core"
+          description="Compiles test-framework classes"/>
+
+  <!-- redefine the clover setup, because we dont want to run clover for the test-framework -->
+  <target name="-clover.setup" if="run.clover"/>
 
   <target name="javadocs-core" depends="javadocs"/>
   <target name="javadocs" depends="init,javadocs-lucene-core,javadocs-lucene-codecs">

Modified: lucene/dev/trunk/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/build.xml?rev=1391382&r1=1391381&r2=1391382&view=diff
==============================================================================
--- lucene/dev/trunk/solr/build.xml (original)
+++ lucene/dev/trunk/solr/build.xml Fri Sep 28 10:12:49 2012
@@ -131,8 +131,9 @@
           depends="compile-core, compile-contrib"/>
   <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
           depends="test-core, test-contrib"/>
+  <!-- "-clover.load" is *not* a useless dependency. do not remove -->
   <target name="test-core" description="Runs the core and solrj unit tests."
-          depends="test-solr-core, test-solrj"/>
+          depends="-clover.load, test-solr-core, test-solrj"/>
   <target name="pitest" description="Validate, then run core, solrj, and contrib unit tests."
           depends="pitest-core, pitest-contrib"/>
   <target name="compile-test" description="Compile unit tests."

Modified: lucene/dev/trunk/solr/test-framework/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/build.xml?rev=1391382&r1=1391381&r2=1391382&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/build.xml (original)
+++ lucene/dev/trunk/solr/test-framework/build.xml Fri Sep 28 10:12:49 2012
@@ -43,6 +43,9 @@
     </compile>
   </target>
 
+  <!-- redefine the clover setup, because we dont want to run clover for the test-framework -->
+  <target name="-clover.setup" if="run.clover"/>
+
   <!-- Override common-solr.javadocs to include JUnit links -->
   <!-- and to copy the built javadocs to ${dest}/docs/api/test-framework -->
   <target name="javadocs"