-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.emma.xml
145 lines (126 loc) · 5.09 KB
/
build.emma.xml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<project name="Emma" default="all" basedir=".">
<description>
Code coverage with Emma for Dependency Finder
</description>
<property environment="env"/>
<path id="emma.lib" >
<fileset dir="${env.EMMA_HOME}/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
<target name="init">
<!-- root directory for the example source code: -->
<property name="src.dir" value="src"/>
<property name="tests.dir" value="tests"/>
<property name="fit.dir" value="fit"/>
<!-- javac class output directory: -->
<property name="out.dir" value="classes"/>
<mkdir dir="${out.dir}"/>
<!-- class coverage output directory: -->
<property name="coverage.dir" value="emma"/>
<mkdir dir="${coverage.dir}"/>
<!-- EMMA instr class output directory: -->
<property name="out.instr.dir" value="${coverage.dir}/outinstr"/>
<mkdir dir="${out.instr.dir}"/>
<!-- class coverage output directory: -->
<property name="reports.dir" value="reports"/>
<property name="emma.reports.dir" value="${reports.dir}/emma"/>
<mkdir dir="${emma.reports.dir}"/>
<path id="run.classpath">
<pathelement location="${out.dir}"/>
<pathelement location="classes"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${env.JUNIT_HOME}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${env.JMOCK_HOME}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${env.CATALINA_HOME}">
<include name="bin/*.jar"/>
<include name="lib/*.jar"/>
</fileset>
<pathelement location="${env.FITLIBRARY_HOME}/fitlibraryRunner.jar"/>
<fileset dir="${env.HTTPUNIT_HOME}">
<include name="**/jars/*.jar"/>
<include name="**/lib/*.jar"/>
</fileset>
</path>
</target>
<target name="tests.compile">
<ant antfile="build.test.xml" target="compile" inheritAll="false"/>
</target>
<target name="tests.clean">
<ant antfile="build.test.xml" target="clean" inheritAll="false"/>
</target>
<target name="all" depends="clean, instrument, run, report"
description="Makes a clean compile and runs code coverage analysis"/>
<target name="clean" depends="init, tests.clean"
description="Removes all produced files">
<delete dir="${coverage.dir}"
includeEmptyDirs="true"
verbose="true"/>
<delete dir="${emma.reports.dir}"
includeEmptyDirs="true"
verbose="true"/>
</target>
<target name="instrument" depends="init, tests.compile"
description="Instruments the bytecode">
<emma>
<instr instrpath="${out.dir}"
destdir="${out.instr.dir}"
metadatafile="${coverage.dir}/metadata.emma"
merge="true">
<filter includes="com.jeantessier.*"
excludes="*.TestAll"/>
</instr>
</emma>
</target>
<target name="run" depends="init"
description="Runs the tests">
<junit fork="true">
<formatter type="plain" usefile="no"/>
<test name="TestAll"/>
<classpath>
<pathelement location="${out.instr.dir}"/>
<path refid="run.classpath"/>
<path refid="emma.lib"/>
</classpath>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
<jvmarg value="-noverify"/>
</junit>
<junit fork="true">
<formatter type="plain" usefile="no"/>
<test name="com.jeantessier.fit.FitTestSuite"/>
<classpath>
<pathelement location="${out.instr.dir}"/>
<path refid="run.classpath"/>
<path refid="emma.lib"/>
</classpath>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
<jvmarg value="-noverify"/>
</junit>
</target>
<target name="report" depends="init"
description="Produces the coverage reports">
<emma>
<report>
<fileset dir="${coverage.dir}">
<include name="*.emma"/>
</fileset>
<sourcepath>
<pathelement location="${src.dir}"/>
<pathelement location="${tests.dir}"/>
<pathelement location="${fit.dir}"/>
</sourcepath>
<txt outfile="${emma.reports.dir}/coverage.txt"/>
<html outfile="${emma.reports.dir}/coverage.html"/>
</report>
</emma>
</target>
</project>