Ver código fonte

Add Clover instrumentation.

Ben Alex 21 anos atrás
pai
commit
4cef58a290
2 arquivos alterados com 83 adições e 0 exclusões
  1. 76 0
      build.xml
  2. 7 0
      lib/clover/license.txt

+ 76 - 0
build.xml

@@ -48,6 +48,7 @@
 		<delete dir="${target.junit.reports.dir}"/>
 		<delete dir="${target.junit.reports.dir}"/>
 		<delete dir="${target.otherclasses.dir}"/>
 		<delete dir="${target.otherclasses.dir}"/>
 		<delete dir="${target.release.dir}"/>
 		<delete dir="${target.release.dir}"/>
+		<delete dir="${target.clover.dir}"/>
 		<delete dir="${target.testclasses.dir}"/>
 		<delete dir="${target.testclasses.dir}"/>
 
 
 	</target>
 	</target>
@@ -350,6 +351,81 @@
 
 
 	</target>
 	</target>
 
 
+	<target name="clover.build" description="Compile main source tree java files WITH CLOVER into class files">
+
+		<!-- 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>
+
+	</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>
+
+
+	<!--
+		Run test suite under Clover coverage analysis, and bring up
+		Clover's Swing browser to display the results.
+	-->
+	<target name="clover.swing" depends="clover.tests" description="Run Clover tests and bring up Swing coverage viewer">
+
+		<echo>Launching coverage viewer</echo>
+
+		<java classname="com.cortexeb.tools.clover.reporters.jfc.Viewer" fork="yes">
+			<arg value="${clover.initstring}"/>
+			<classpath refid="qa-portalpath"/>
+		</java>
+
+	</target>
+
+
+	<!--
+		Run test suite under Clover coverage analysis, and use Clover
+		to generate Javadoc/style HTML results that may be browsed later.
+	-->
+	<target name="clover.html" depends="clover.tests" description="Generate Clover HTML coverage reports from an existing Clover database">
+
+		<java classname="com.cortexeb.tools.clover.reporters.html.HtmlReporter" fork="yes">
+			<arg line="-o '${target.clover.html.dir}' -i '${clover.initstring}' -t 'Acegi Security System for Spring'"/>
+			<classpath refid="qa-portalpath"/>
+		</java>
+
+	</target>
+
+
 	<target name="docclean" description="Delete temporary and distribution directories for docs">
 	<target name="docclean" description="Delete temporary and distribution directories for docs">
 
 
 		<delete quiet="true" dir="${basedir}/${dist.ref.dir}/pdf"/>
 		<delete quiet="true" dir="${basedir}/${dist.ref.dir}/pdf"/>

+ 7 - 0
lib/clover/license.txt

@@ -0,0 +1,7 @@
+Cortex has supported the Acegi Security System for Spring project with a free
+Team Edition license of Clover.
+
+We thank Cortext for their support.
+
+
+$Id$