aboutsummaryrefslogtreecommitdiffstats
path: root/fop/jacoco.xml
blob: 43e5f394b26a1d49f08daabfbba5006e832efb81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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">
    <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>