浏览代码

* 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.

Francois Beausoleil 21 年之前
父节点
当前提交
61b657318d
共有 2 个文件被更改,包括 7 次插入39 次删除
  1. 4 35
      build.xml
  2. 3 4
      project.properties

+ 4 - 35
build.xml

@@ -354,48 +354,17 @@
 
 	<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 -->
 		<property name="build.compiler" value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
 
-		<mkdir dir="${target.clover.dir}"/>
-
-		<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>
+		<antcall target="build"/>
 
 	</target>
 
 
-	<target name="clover.tests" depends="buildtests,clover.build" 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>
-
+	<target name="clover.tests" depends="clover.build,buildtests,tests" description="Run Clover tests"/>
 
 	<!--
 		Run test suite under Clover coverage analysis, and bring up

+ 3 - 4
project.properties

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