aboutsummaryrefslogtreecommitdiffstats
path: root/jacoco.xml
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2011-11-18 17:08:20 +0000
committerVincent Hennebert <vhennebert@apache.org>2011-11-18 17:08:20 +0000
commit07f082ad3d6afb717e55972ae0c4a64c5d1e53b4 (patch)
treeec9ee565983d13ee7154c8645a9ebf68b93ed96a /jacoco.xml
parent3d2b970d8e559003aea495c0e2a941d0c7d81160 (diff)
downloadxmlgraphics-fop-07f082ad3d6afb717e55972ae0c4a64c5d1e53b4.tar.gz
xmlgraphics-fop-07f082ad3d6afb717e55972ae0c4a64c5d1e53b4.zip
Bugzilla #52151: added ant script to get JaCoCo code coverage
Patch by Mehdi Houshmand, applied with changes git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1203749 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'jacoco.xml')
-rw-r--r--jacoco.xml38
1 files changed, 38 insertions, 0 deletions
diff --git a/jacoco.xml b/jacoco.xml
new file mode 100644
index 000000000..679b78c8a
--- /dev/null
+++ b/jacoco.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<project xmlns:jacoco="antlib:org.jacoco.ant" name="JaCoCo" default="coverage-report">
+ <import file="build.xml"/>
+ <property name="jacoco.report.dir" value="${build.dir}/report_jacoco"/>
+ <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
+ <classpath location="${jacocoant.jar}"/>
+ </taskdef>
+ <target name="test-coverage" depends="junit-compile, setup-xml-schema">
+ <jacoco:coverage destfile="${jacoco.report.dir}/jacoco.exec">
+ <junit dir="${basedir}" haltonfailure="yes" fork="on" forkmode="once">
+ <sysproperty key="jawa.awt.headless" value="true"/>
+ <classpath>
+ <path refid="standard-junit-classpath"/>
+ </classpath>
+ <batchtest>
+ <fileset dir="${build.unit.tests.dir}" includes="**/*TestCase.class"/>
+ </batchtest>
+ </junit>
+ </jacoco:coverage>
+ </target>
+ <target name="coverage-report" depends="test-coverage"
+ description="Runs JaCoCo for a code coverage report">
+ <jacoco:report>
+ <executiondata>
+ <file file="${jacoco.report.dir}/jacoco.exec"/>
+ </executiondata>
+ <structure name="Apache FOP">
+ <classfiles>
+ <fileset dir="${build.classes.dir}"/>
+ </classfiles>
+ <sourcefiles>
+ <fileset dir="${src.java.dir}"/>
+ </sourcefiles>
+ </structure>
+ <html destdir="${jacoco.report.dir}"/>
+ </jacoco:report>
+ </target>
+</project>