LUCENE-3753: Clover fixes: Added non-clover-invoking compile-core target specializations to the lucene/test-framework and lucene/tools modules, since these classes have no tests, and lucene/test-framework sources are already included in every other module's clover instrumentation; and moved generate-clover-reports from lucene/common-build.xml to lucene/build.xml, since it doesn't need to be shared elsewhere.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1241986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-02-08 17:14:57 +00:00
parent 9c7fbf58e9
commit 534ecb309b
4 changed files with 63 additions and 40 deletions

View File

@ -143,6 +143,44 @@
<target name="compile-core" depends="compile-lucene-core"/>
<!--
Run after Junit tests.
-->
<target name="generate-clover-reports" depends="clover.check, clover">
<mkdir dir="${clover.report.dir}"/>
<!-- This extra path is needed, because from a top-level ant run, the contrib tests would be not visible (report generation is only done on top-level not via subants) -->
<fileset dir="contrib" id="clover.contrib.test.src.files">
<include name="**/test/**/*.java"/>
</fileset>
<fileset dir="${tests-framework.src.dir}" id="clover.test-framework.src.files">
<include name="**/*.java" />
</fileset>
<fileset dir="${tests.src.dir}" id="clover.test.src.files">
<include name="**/*.java" />
</fileset>
<fileset dir="${build.dir}" id="clover.test.result.files">
<include name="**/test/TEST-*.xml" />
<!-- do not include BW tests -->
<exclude name="backwards/**"/>
</fileset>
<clover-report>
<current outfile="${clover.report.dir}" title="${final.name}" numThreads="0">
<format type="html" filter="assert"/>
<testsources refid="clover.test.src.files"/>
<testsources refid="clover.test-framework.src.files"/>
<testsources refid="clover.contrib.test.src.files"/>
<testresults refid="clover.test.result.files"/>
</current>
<current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
<format type="xml" filter="assert"/>
<testsources refid="clover.test.src.files"/>
<testsources refid="clover.test-framework.src.files"/>
<testsources refid="clover.contrib.test.src.files"/>
<testresults refid="clover.test.result.files"/>
</current>
</clover-report>
</target>
<!-- ================================================================== -->
<!-- D O C U M E N T A T I O N -->
<!-- ================================================================== -->

View File

@ -737,43 +737,6 @@
##################################################################
</fail>
</target>
<!--
Run after Junit tests.
-->
<target name="generate-clover-reports" depends="clover.check, clover">
<mkdir dir="${clover.report.dir}"/>
<!-- This extra path is needed, because from a top-level ant run, the contrib tests would be not visible (report generation is only done on top-level not via subants) -->
<fileset dir="contrib" id="clover.contrib.test.src.files">
<include name="**/test/**/*.java"/>
</fileset>
<fileset dir="${tests-framework.src.dir}" id="clover.test-framework.src.files">
<include name="**/*.java" />
</fileset>
<fileset dir="${tests.src.dir}" id="clover.test.src.files">
<include name="**/*.java" />
</fileset>
<fileset dir="${build.dir}" id="clover.test.result.files">
<include name="**/test/TEST-*.xml" />
<!-- do not include BW tests -->
<exclude name="backwards/**"/>
</fileset>
<clover-report>
<current outfile="${clover.report.dir}" title="${final.name}" numThreads="0">
<format type="html" filter="assert"/>
<testsources refid="clover.test.src.files"/>
<testsources refid="clover.test-framework.src.files"/>
<testsources refid="clover.contrib.test.src.files"/>
<testresults refid="clover.test.result.files"/>
</current>
<current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
<format type="xml" filter="assert"/>
<testsources refid="clover.test.src.files"/>
<testsources refid="clover.test-framework.src.files"/>
<testsources refid="clover.contrib.test.src.files"/>
<testresults refid="clover.test.result.files"/>
</current>
</clover-report>
</target>
<target name="generate-test-reports" description="Generates test reports">
<mkdir dir="${junit.reports}"/>

View File

@ -30,7 +30,20 @@
<path refid="ant-path"/>
</path>
<target name="compile-core" depends="compile-lucene-core,common.compile-core" />
<!--
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.
-->
<target name="compile-core" depends="init,compile-lucene-core"
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="javadocs-core" depends="javadocs"/>
<target name="javadocs">

View File

@ -24,7 +24,16 @@
<import file="../common-build.xml"/>
<target name="javadocs"/> <!-- to make common-build.xml happy -->
<path id="classpath"/>
<!--
Specialize compile-core to not depend on clover, to exclude a
classpath reference when compiling, and to not attempt to copy
non-existent resource files to the build output directory.
-->
<target name="compile-core" depends="init" description="Compiles tools classes">
<compile srcdir="${src.dir}" destdir="${build.dir}/classes/java"/>
</target>
<target name="javadocs"/> <!-- to make common-build.xml happy -->
</project>