SOLR-2452: Put back Solr-specific clover properties & targets

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1144847 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2011-07-10 12:20:06 +00:00
parent c5636fac7d
commit afda0fa29c
2 changed files with 70 additions and 1 deletions

View File

@ -32,7 +32,7 @@
<echo message="Use 'ant luke' to start luke. see: http://luke.googlecode.com" /> <echo message="Use 'ant luke' to start luke. see: http://luke.googlecode.com" />
<echo message="Use 'ant test' to run unit tests." /> <echo message="Use 'ant test' to run unit tests." />
</target> </target>
<import file="common-build.xml"/> <import file="common-build.xml"/>
<!-- ========================================================================= --> <!-- ========================================================================= -->
@ -171,6 +171,65 @@
</fileset> </fileset>
</delete> </delete>
</target> </target>
<!-- Clover targets -->
<target name="clover" depends="clover.setup, clover.info"
description="Instrument the Unit tests using Clover. Requires a Clover license and clover.jar in the ANT classpath. To use, specify -Drun.clover=true on the command line."/>
<target name="clover.setup" if="clover.enabled">
<taskdef resource="cloverlib.xml"/>
<mkdir dir="${clover.db.dir}"/>
<clover-setup initString="${clover.db.dir}/solr_coverage.db">
<fileset dir="core/src/java"/>
<fileset dir="solrj/src/java"/>
<fileset dir="contrib/analysis-extras/src/java"/>
<fileset dir="contrib/clustering/src/java"/>
<fileset dir="contrib/dataimporthandler/src/java"/>
<fileset dir="contrib/dataimporthandler-extras/src/java"/>
<fileset dir="contrib/extraction/src/java"/>
<fileset dir="contrib/uima/src/java"/>
<testsources dir="test-framework/src/java"/>
<testsources dir="core/src/test"/>
<testsources dir="solrj/src/test"/>
<testsources dir="contrib/analysis-extras/src/test" />
<testsources dir="contrib/clustering/src/test" />
<testsources dir="contrib/dataimporthandler/src/test" />
<testsources dir="contrib/dataimporthandler-extras/src/test" />
<testsources dir="contrib/extraction/src/test" />
<testsources dir="contrib/uima/src/test" />
</clover-setup>
</target>
<target name="clover.info" unless="clover.present">
<echo>
Clover not found. Code coverage reports disabled.
</echo>
</target>
<target name="clover.check">
<fail unless="clover.present">
##################################################################
Clover not found.
Please make sure clover.jar is in ANT_HOME/lib, or made available
to Ant using other mechanisms like -lib or CLASSPATH.
##################################################################
</fail>
</target>
<!-- Run after Junit tests. -->
<target name="generate-clover-reports" depends="clover.check, clover">
<mkdir dir="${clover.report.dir}"/>
<clover-report>
<current outfile="${clover.report.dir}/clover.xml"
title="${fullnamever}">
<format type="xml"/>
</current>
<current outfile="${clover.report.dir}" title="${fullnamever}">
<format type="html"/>
</current>
</clover-report>
</target>
<!-- ========================================================================= --> <!-- ========================================================================= -->
<!-- ===================== DISTRIBUTION-RELATED TASKS ======================== --> <!-- ===================== DISTRIBUTION-RELATED TASKS ======================== -->

View File

@ -48,6 +48,16 @@
<property name="tests.threadspercpu" value="2"/> <property name="tests.threadspercpu" value="2"/>
<property name="tests.cleanthreads.sysprop" value="perClass"/> <property name="tests.cleanthreads.sysprop" value="perClass"/>
<property name="clover.db.dir" location="${dest}/tests/clover/db"/>
<property name="clover.report.dir" location="${dest}/tests/clover/reports"/>
<available property="clover.present" classname="com.cenqua.clover.tasks.CloverReportTask"/>
<condition property="clover.enabled">
<and>
<isset property="run.clover"/>
<isset property="clover.present"/>
</and>
</condition>
<path id="additional.dependencies"> <path id="additional.dependencies">
<fileset dir="${common-solr.dir}/lib" includes="**/*.jar"/> <fileset dir="${common-solr.dir}/lib" includes="**/*.jar"/>
<fileset dir="${common-solr.dir}/example/lib" includes="**/*.jar"/> <fileset dir="${common-solr.dir}/example/lib" includes="**/*.jar"/>