Skip to content

Commit b299133

Browse files
committed
Adding Cobertura
1 parent 7963728 commit b299133

File tree

6 files changed

+32
-31
lines changed

6 files changed

+32
-31
lines changed

build.xml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,29 @@ limitations under the License.
3636
<property name="testdir" location="${targetdir}/test"/>
3737
<dirname property="javabase" file="${java.home}"/>
3838

39-
<property name="clover.jar" location="${env.CLOVER_HOME}/lib/clover.jar"/>
40-
4139
<property name="test.com.mongodb.slaveAcceptableLatencyMS" value="15"/>
4240

43-
<taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
4441
<path id="classpath">
45-
<fileset dir="lib"><include name="**/*.jar"/></fileset>
42+
<fileset dir="lib"><include name="*.jar"/></fileset>
4643
<pathelement path="conf" />
4744
<pathelement path="build/main" />
4845
<pathelement path="build/test" />
4946
<pathelement path="${javabase}/lib/tools.jar" />
5047
</path>
5148

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>
5955
</path>
6056

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+
6162
<!-- ******************************************************************* -->
6263
<!-- The init target. -->
6364
<!-- ******************************************************************* -->
@@ -353,33 +354,33 @@ limitations under the License.
353354
</junitreport>
354355
</target>
355356

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-
370357
<target name="jenkins-test" depends="compile">
371358

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">
373360
<jvmarg value="-Xmx512M" />
374361
<jvmarg value="-ea" />
375362
<jvmarg value="-Dcom.mongodb.slaveAcceptableLatencyMS=${test.com.mongodb.slaveAcceptableLatencyMS}"/>
376363
<xmlfileset dir="." includes="testng.xml"/>
377364
</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}"/>
383384
</target>
384385

385386

lib/cobertura/asm-3.0.jar

41.7 KB
Binary file not shown.

lib/cobertura/asm-tree-3.0.jar

21 KB
Binary file not shown.

lib/cobertura/cobertura-1.9.4.1.jar

443 KB
Binary file not shown.

lib/cobertura/jakarta-oro-2.0.8.jar

63.7 KB
Binary file not shown.

lib/cobertura/log4j-1.2.9.jar

344 KB
Binary file not shown.

0 commit comments

Comments
 (0)