blob: d4522e247512cec2f98bd893f41d23d5364491a5 [file] [log] [blame]
<?xml version="1.0" standalone='yes'?>
<!-- This Ant build file fragment contains targets needed to run
code coverage analysis
<project name="Code coverage tasks for Jackson" basedir=".">
<!-- Support for Cobertura code coverage tool -->
<property name="cobertura.coverage.dir" value="${}/coverage" />
<path id="cobertura.lib">
<fileset dir="${dir.lib}/cobertura" includes="*.jar" />
<fileset dir="${dir.lib}/ext/asm" includes="*.jar" />
<taskdef classpathref="cobertura.lib" resource="" />
<!-- Code coverage using Cobertura: -->
<target name="build.coverage" depends="test.compile">
<!-- First, need to instrument classes -->
<property name="cobertura.instr.dir" value="${}/cobertura-instr" />
<cobertura-instrument todir="${cobertura.instr.dir}">
<fileset dir="${}">
<include name="org/codehaus/jackson/**/*.class"/>
<fileset dir="${}">
<include name="org/codehaus/jackson/map/**/*.class"/>
<include name="org/codehaus/jackson/node/**/*.class"/>
<include name="org/codehaus/jackson/schema/**/*.class"/>
<junit fork="once" printsummary="yes" haltonfailure="no" showoutput="yes"
<sysproperty key="net.sourceforge.cobertura.datafile" file="${basedir}/cobertura.ser" />
<batchtest fork="no" todir="${dir.test.xmlresults}">
<fileset dir="${dir.test.classes}">
<!-- Need to exclude inner classes... -->
<exclude name="**/*$*.class"/>
<!-- and one particularly slow test? -->
<exclude name="**/TestStringGeneration.class"/>
<include name="**/Test*.class"/>
<formatter type="xml" />
<!-- Order is important: must first have instrumented classes -->
<classpath location="${cobertura.instr.dir}" />
<!-- Actual tests: -->
<classpath path="${dir.test.classes}" />
<!-- Cobertura support: -->
<classpath refid="cobertura.lib" />
<!-- Note: while this may seem superfluous, it is actually
needed because Cobertura does not instrument things
like interfaces. So some of the class files are
needed from non-instrumented location
<pathelement path="${}" />
<pathelement path="${}" />
<pathelement path="${}" />
<path refid="test-libs"/>
<!-- and then reporting -->
<cobertura-report format="html" destdir="${cobertura.coverage.dir}" >
<fileset dir="${}">
<include name="org/codehaus/**/*.java" />
<fileset dir="${}">
<include name="org/codehaus/**/*.java" />
<fileset dir="${}">
<include name="org/codehaus/**/*.java" />
<!-- Let's also report junit results? (at least if they fail) -->
<junitreport todir="${dir.test.results}">
<fileset dir="${dir.test.xmlresults}">
<include name="TEST-*.xml" />
<report todir="${dir.test.results}" />