Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding Cobertura

  • Loading branch information...
commit b2991334d35f5faca7100e4a4951e89f87df0e35 1 parent 7963728
Uladzimir Mihura authored September 07, 2012
63  build.xml
@@ -36,28 +36,29 @@ limitations under the License.
36 36
     <property name="testdir" location="${targetdir}/test"/>
37 37
     <dirname property="javabase" file="${java.home}"/>
38 38
 
39  
-    <property name="clover.jar" location="${env.CLOVER_HOME}/lib/clover.jar"/>
40  
-
41 39
     <property name="test.com.mongodb.slaveAcceptableLatencyMS" value="15"/>
42 40
 
43  
-    <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
44 41
     <path id="classpath">
45  
-        <fileset dir="lib"><include name="**/*.jar"/></fileset>
  42
+        <fileset dir="lib"><include name="*.jar"/></fileset>
46 43
         <pathelement path="conf" />
47 44
         <pathelement path="build/main" />
48 45
         <pathelement path="build/test" />
49 46
         <pathelement path="${javabase}/lib/tools.jar" />
50 47
     </path>
51 48
 
52  
-    <path id="classpath.clover">
53  
-        <fileset dir="lib"><include name="**/*.jar"/></fileset>
54  
-        <pathelement path="conf" />
55  
-        <pathelement path="build/main" />
56  
-        <pathelement path="build/test" />
57  
-        <pathelement path="${javabase}/lib/tools.jar" />
58  
-        <pathelement path="${clover.jar}" />
  49
+    <!-- ******************************************************************* -->
  50
+    <!-- Set the Cobertura attributes.                                       -->
  51
+    <!-- ******************************************************************* -->
  52
+
  53
+    <path id="cobertura.classpath">
  54
+        <fileset dir="lib/cobertura"><include name="**/*.jar"/></fileset>
59 55
     </path>
60 56
 
  57
+    <property name="cobertura.instrumented" location="build/instrumented"/>
  58
+    <property name="cobertura.datafile" location="${targetdir}/cobertura.ser"/>
  59
+
  60
+    <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
  61
+
61 62
     <!-- ******************************************************************* -->
62 63
     <!-- The init target.                                                    -->
63 64
     <!-- ******************************************************************* -->
@@ -353,33 +354,33 @@ limitations under the License.
353 354
         </junitreport>
354 355
     </target>
355 356
 
356  
-	  	
357  
-	  	
358  
-    <target name="-check.clover">
359  
-      <available property="clover.installed" classname="com.cenqua.clover.CloverInstr" />
360  
-    </target>
361  
-            
362  
-    <target name="with.clover" depends="guard.noclover">
363  
-        <clover-setup/>
364  
-    </target>
365  
-            
366  
-    <target name="guard.noclover" depends="-check.clover" unless="clover.installed">
367  
-      <fail message="The target you are attempting to run requires Clover, which doesn't appear to be installed"/>
368  
-    </target>
369  
-
370 357
     <target name="jenkins-test" depends="compile">
371 358
 
372  
-        <testng classpathref="classpath.clover" outputdir="${testdir}" listeners="com.mongodb.util.TestNGListener" haltonfailure="false" verbose="1">
  359
+        <testng classpathref="classpath" outputdir="${testdir}" listeners="com.mongodb.util.TestNGListener" haltonfailure="false" verbose="1">
373 360
             <jvmarg value="-Xmx512M" />
374 361
             <jvmarg value="-ea" />
375 362
             <jvmarg value="-Dcom.mongodb.slaveAcceptableLatencyMS=${test.com.mongodb.slaveAcceptableLatencyMS}"/>
376 363
             <xmlfileset dir="." includes="testng.xml"/>
377 364
         </testng>
378  
-        <!--<clover-report>-->
379  
-            <!--<current outfile="coverage.xml">-->
380  
-                <!--<format type="xml"/>-->
381  
-            <!--</current>-->
382  
-        <!--</clover-report>-->
  365
+    </target>
  366
+
  367
+    <target name="jenkins-test-coverage" depends="compile">
  368
+
  369
+        <cobertura-instrument todir="${cobertura.instrumented}" datafile="${cobertura.datafile}">
  370
+            <fileset dir="build/main">
  371
+                <include name="**/*.class"/>
  372
+            </fileset>
  373
+        </cobertura-instrument>
  374
+
  375
+        <testng outputdir="${testdir}" listeners="com.mongodb.util.TestNGListener" haltonfailure="false" verbose="1">
  376
+            <classpath location="${cobertura.instrumented}"/>
  377
+            <classpath refid="classpath"/>
  378
+            <classpath refid="cobertura.classpath"/>
  379
+            <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
  380
+            <jvmarg value="-Xmx512M"/>
  381
+            <xmlfileset dir="." includes="testng.xml"/>
  382
+        </testng>
  383
+        <cobertura-report format="xml" srcdir="src/main" destdir="${testdir}" datafile="${cobertura.datafile}"/>
383 384
     </target>
384 385
 
385 386
 
BIN  lib/cobertura/asm-3.0.jar
Binary file not shown
BIN  lib/cobertura/asm-tree-3.0.jar
Binary file not shown
BIN  lib/cobertura/cobertura-1.9.4.1.jar
Binary file not shown
BIN  lib/cobertura/jakarta-oro-2.0.8.jar
Binary file not shown
BIN  lib/cobertura/log4j-1.2.9.jar
Binary file not shown

0 notes on commit b299133

Please sign in to comment.
Something went wrong with that request. Please try again.