-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild-tests.xml
200 lines (187 loc) · 7.81 KB
/
build-tests.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?xml version="1.0" encoding="UTF-8"?>
<project name="biobank-tests" basedir=".">
<property file="build.properties" />
<property name="test.output" location="testing" />
<property name="test.output.raw" value="${test.output}/raw" />
<property name="test.build.dir" value="${eclipse.proj.dir.tests}/output" />
<property name="coverage.output" location="coverage" />
<path id="common.class.path">
<fileset dir="${eclipse.proj.dir.common}/lib/client">
<include name="*.jar" />
</fileset>
</path>
<path id="test.class.path">
<pathelement location="${test.build.dir}" />
</path>
<target name="clean-test-results">
<delete dir="${test.output}" quiet="true"/>
</target>
<target name="clean-tests" depends="clean-test-results">
<delete dir="${test.build.dir}" />
</target>
<target name="test-prepare">
<mkdir dir="${test.build.dir}" />
<mkdir dir="${test.output}" />
<mkdir dir="${test.output.raw}" />
</target>
<!---->
<target name="tests-compile" depends="build-common-project,tools-compile,test-prepare" >
<copy includeemptydirs="false"
todir="${test.build.dir}" overwrite="true">
<fileset dir="${eclipse.proj.dir.tests}/src">
<exclude name="**/*.launch" />
<exclude name="**/*.java" />
</fileset>
</copy>
<javac destdir="${test.build.dir}"
debug="true"
debuglevel="lines,source"
includeantruntime="false">
<src path="${eclipse.proj.dir.tests}/src" />
<include name="**/test/reports/**/*.java" />
<include name="**/Test*.java" />
<!--
do not include the tests in edu.ualberta.med.biobank.test.batchoperation
however, the tests in edu.ualberta.med.biobank.test.action.batchoperation are included
-->
<exclude name="**/test/batchoperation/**" />
<exclude name="**/test/action/security/util/**" />
<exclude name="**/test/action/tmp/**" />
<exclude name="**/presenters/**" />
<exclude name="**/TestingDispatcher.java" />
<classpath>
<pathelement location="${eclipse.proj.dir.common}/output" />
<pathelement location="${eclipse.proj.dir.tools}/output" />
<pathelement location="${eclipse.proj.dir.tests}/lib/junit.jar" />
<fileset dir="${eclipse.proj.dir.tools}/lib">
<include name="*.jar" />
</fileset>
</classpath>
<classpath refid="biobank.common.build.classpath" />
</javac>
</target>
<fileset id="testcase.files" dir="${eclipse.proj.dir.tests}/src">
<exclude name="**/wrappers/**" />
<exclude name="**/presenters/**" />
<!--
do not include the tests in edu.ualberta.med.biobank.test.batchoperation
however, the tests in edu.ualberta.med.biobank.test.action.batchoperation are included
-->
<exclude name="**/test/batchoperation/**" />
<exclude name="**/test/action/security/util/**" />
<exclude name="**/test/action/tmp/**" />
<exclude name="**/TestAction.java" />
<exclude name="**/TestCommon.java" />
<exclude name="**/TestDatabase.java" />
<exclude name="**/TestDb.java" />
<exclude name="**/TestingDispatcher.java" />
<exclude name="**/TestHibernateLocking.java" />
<exclude name="**/TestReportsOnExistingData.java" />
<exclude name="**/TestReportsProcedurallyGeneratedData.java" />
<include name="**/Test*.java" />
<exclude name="**/TestFixture.java" />
</fileset>
<target name="test" depends="clean-test-results,tests-compile" description="executes test cases">
<junit printsummary="yes" haltonfailure="no" showoutput="yes" fork="true">
<classpath refid="test.class.path" />
<classpath refid="biobank.common.run.classpath" />
<classpath>
<pathelement location="${eclipse.proj.dir.tools}/output" />
<pathelement location="${eclipse.proj.dir.tools}/lib/naming-common.jar" />
<pathelement location="${eclipse.proj.dir.tests}/lib/junit.jar" />
<pathelement location="${eclipse.proj.dir.tests}/lib/clm.jar" />
<pathelement location="${eclipse.proj.dir.tests}/conf" />
</classpath>
<sysproperty key="db.properties" value="db.properties" />
<sysproperty key="server" value="http://localhost:8080" />
<formatter usefile="yes" type="xml" />
<test name="${testcase}" todir="${test.output.raw}" if="testcase" />
<batchtest todir="${test.output.raw}" unless="testcase">
<fileset refid="testcase.files" />
</batchtest>
</junit>
<junitreport todir="${test.output}">
<fileset dir="${test.output.raw}">
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="${test.output}/html" />
</junitreport>
<echo message="test report: file://${test.output}/html/junit-noframes.html" />
</target>
<property name="emma.dir" value="${req.jars.dir}/build" />
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>
<target name="emma"
description="turns on EMMA's on-the-fly instrumentation mode">
<property name="emma.enabled" value="true" />
</target>
<target name="test-emma"
depends="tests-compile"
description="executes test cases with code coverage">
<delete file="${test.output}/coverage.emma" />
<junit printsummary="yes" haltonfailure="no" showoutput="yes" fork="true">
<classpath refid="test.class.path" />
<classpath refid="biobank.common.run.classpath" />
<classpath refid="emma.lib" />
<classpath>
<pathelement location="${eclipse.proj.dir.tools}/output" />
<pathelement location="${eclipse.proj.dir.tools}/lib/naming-common.jar" />
<pathelement location="${eclipse.proj.dir.tests}/lib/junit.jar" />
<pathelement location="${eclipse.proj.dir.tests}/lib/clm.jar" />
<pathelement location="${eclipse.proj.dir.tools}/lib/naming-common.jar" />
<pathelement location="${eclipse.proj.dir.tests}/conf" />
</classpath>
<formatter usefile="yes" type="brief" />
<formatter type="xml" />
<test name="${testcase}" todir="${test.output.raw}" if="testcase" />
<batchtest todir="testing/raw" unless="testcase">
<fileset refid="testcase.files" />
</batchtest>
<!-- note that his property MUST come before the emmarun command -->
<jvmarg value="-Ddb.properties=db.properties" />
<jvmarg value="-Xbootclasspath/a:${emma.dir}/emma.jar" />
<jvmarg value="emmarun" />
<jvmarg value="-out" />
<jvmarg value="${test.output}/coverage.emma" />
<jvmarg value="-raw" />
<jvmarg value="-merge" />
<jvmarg value="yes" />
<jvmarg value="-ix" />
<jvmarg value="edu.ualberta.med.biobank.common*" />
</junit>
<junitreport todir="${test.output}">
<fileset dir="${test.output.raw}">
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="${test.output}/html" />
</junitreport>
<java classname="emma" fork="true" failonerror="true">
<arg value="report" />
<arg value="-r" />
<arg value="xml" />
<arg value="-sp" />
<arg value="eclipse_ws/biobank.common/src" />
<arg value="-in" />
<arg value="testing/coverage.emma" />
<classpath>
<pathelement path="${emma.dir}/emma.jar" />
</classpath>
</java>
<java classname="emma" fork="true" failonerror="true">
<arg value="report" />
<arg value="-r" />
<arg value="html" />
<arg value="-sp" />
<arg value="eclipse_ws/biobank.common/src" />
<arg value="-in" />
<arg value="testing/coverage.emma" />
<classpath>
<pathelement path="${emma.dir}/emma.jar" />
</classpath>
</java>
<echo message="test report: file://${test.output}/html/junit-noframes.html" />
<echo message="coverage report: file://${coverage.output}/index.html" />
</target>
</project>