* build.xml:

Changed the way the Clover report is generated.
  Used the existing targets, instead of having to maintain two different sets
    of targets to build with or without Clover.
  Changed order of target dependencies for clover.tests so that instrumented
    classes are built before the test classes.
  Removed the separate target folder for instrumented classes.  If a separate
    target folder is used, separate classpaths are required when testing with
    Clover than when not using Clover.

* project.properties:
  Removed the target.clover.dir property definition.
  Updated clover.dbdir to put the DB somewhere safe.
  Set clover.excluded so as not instrument the test classes themselves.
This commit is contained in:
Francois Beausoleil 2004-03-23 18:16:40 +00:00
parent cd2727b85b
commit 61b657318d
2 changed files with 7 additions and 39 deletions

View File

@ -354,48 +354,17 @@
<target name="clover.build" description="Compile main source tree java files WITH CLOVER into class files"> <target name="clover.build" description="Compile main source tree java files WITH CLOVER into class files">
<mkdir dir="${clover.dbdir}"/>
<!-- switch on Clover by specifying it as the compiler to use --> <!-- switch on Clover by specifying it as the compiler to use -->
<property name="build.compiler" value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/> <property name="build.compiler" value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
<mkdir dir="${target.clover.dir}"/> <antcall target="build"/>
<javac destdir="${target.clover.dir}" target="1.3" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="qa-portalpath"/>
</javac>
<copy todir="${target.clover.dir}" preservelastmodified="true">
<fileset dir="${src.dir}">
<include name="**/*.xml"/>
<include name="**/*.dtd"/>
</fileset>
</copy>
</target> </target>
<target name="clover.tests" depends="buildtests,clover.build" description="Run Clover tests"> <target name="clover.tests" depends="clover.build,buildtests,tests" description="Run Clover tests"/>
<junit printsummary="yes" haltonfailure="yes">
<!-- Must go first to ensure the jndi.properties takes precedence -->
<classpath location="${target.testclasses.dir}"/>
<classpath location="${target.clover.dir}"/>
<!-- Need files loaded as resources -->
<classpath location="${test.dir}"/>
<classpath refid="qa-portalpath"/>
<batchtest fork="yes">
<fileset dir="${target.testclasses.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
</batchtest>
</junit>
</target>
<!-- <!--
Run test suite under Clover coverage analysis, and bring up Run test suite under Clover coverage analysis, and bring up

View File

@ -75,9 +75,8 @@ target.otherclasses.dir=${target.dir}/other-classes
# Where to find code formatting rules # Where to find code formatting rules
jalopy.xml=jalopy.xml jalopy.xml=jalopy.xml
# Where we generate instrumented (Cloverised) classes # Clover properties
target.clover.dir=${target.dir}/clover clover.dbdir=${target.dir}/clover
clover.dbdir=${target.clover.dir}
clover.dbfile=acegi_security_coverage.db clover.dbfile=acegi_security_coverage.db
clover.initstring=${clover.dbdir}/${clover.dbfile} clover.initstring=${clover.dbdir}/${clover.dbfile}
target.clover.html.dir=${target.dir}/clover-reports target.clover.html.dir=${target.dir}/clover-reports
@ -85,7 +84,7 @@ target.clover.html.dir=${target.dir}/clover-reports
# Global property to exclude selected classes from Clover instrumentation. # Global property to exclude selected classes from Clover instrumentation.
# Typically we'll use this to exclude experimental packages from coverage # Typically we'll use this to exclude experimental packages from coverage
# analysis, or classes that are intended to support development. # analysis, or classes that are intended to support development.
clover.excludes= clover.excludes=**/*Exception.java:**/*Tests.java
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# docbook reference documentation # docbook reference documentation