|
14 | 14 | <property name="java14-home" value="${env.JAVA14_HOME}" /> |
15 | 15 | <property name="clover-jar" value="${env.CLOVER_JAR}" /> |
16 | 16 |
|
17 | | - |
18 | | - <!-- By default, don't filter tests on anything --> |
| 17 | + <!-- Testing defaults --> |
19 | 18 | <property name="test-spec" value="" /> |
| 19 | + <property name="test-repeat" value="1" /> <!-- TODO: Use this value --> |
| 20 | + <property name="test-timeout" value="1440" /> |
20 | 21 |
|
21 | 22 | <!-- By default, clean can fail --> |
22 | 23 | <property name="clean-can-fail" value="yes" /> |
|
42 | 43 | <taskdef resource="com/cenqua/ant/antlib.xml" classpath="lib/buildlib/cenquatasks.jar" /> |
43 | 44 | <extendclasspath path="lib/buildlib/junit.jar" /> |
44 | 45 |
|
| 46 | + <!-- Extension containing various tools, including "for" and "if" --> |
| 47 | + <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="lib/buildlib/ant-contrib.jar"/> |
45 | 48 |
|
46 | 49 | <!-- *********** |
47 | 50 | Help Target |
|
223 | 226 | <target name="test" depends="test-15" description="Shortcut for 'test-15'"> |
224 | 227 | </target> |
225 | 228 |
|
226 | | - |
227 | | - <target name="test-15" depends="compile-15, assert-15" |
| 229 | + <target name="test-15" depends="compile-15" |
228 | 230 | description="Run all 5.0 tests under Java 5.0 (after compiling); use -Dtest-spec=... to filter"> |
229 | | - <echo message="Running all 5.0 tests matching '${test-spec}' under Java 5.0" /> |
| 231 | + <antcall target="iterate-tests"> |
| 232 | + <param name="do-test-target" value="do-test-15" /> |
| 233 | + </antcall> |
| 234 | + </target> |
| 235 | + |
| 236 | + <target name="test-14" depends="compile-14" |
| 237 | + description="Run all 1.4 tests under Java 1.4 (after compiling); use -Dtest-spec=... to filter"> |
| 238 | + <antcall target="iterate-tests"> |
| 239 | + <param name="do-test-target" value="do-test-14" /> |
| 240 | + </antcall> |
| 241 | + </target> |
| 242 | + |
| 243 | + <target name="test-14-in-15" depends="compile-14, assert-15" |
| 244 | + description="Run all 1.4 tests under Java 5.0 (after compiling); use -Dtest-spec=... to filter"> |
| 245 | + <antcall target="iterate-tests"> |
| 246 | + <param name="do-test-target" value="do-test-14-in-15" /> |
| 247 | + </antcall> |
| 248 | + </target> |
| 249 | + |
| 250 | + <target name="iterate-tests"> |
| 251 | + <if> |
| 252 | + <equals arg1="${test-spec}" arg2="" /> |
| 253 | + <then> |
| 254 | + <limit minutes="${test-timeout}" failonerror="true"> |
| 255 | + <antcall target="${do-test-target}"> |
| 256 | + <param name="test-filter-string" value="" /> |
| 257 | + </antcall> |
| 258 | + </limit> |
| 259 | + </then> |
| 260 | + <else> |
| 261 | + <for list="${test-spec}" param="test-filter-string-attribute"> |
| 262 | + <sequential> |
| 263 | + <limit minutes="${test-timeout}" failonerror="true"> |
| 264 | + <antcall target="${do-test-target}"> |
| 265 | + <param name="test-filter-string" value="@{test-filter-string-attribute}" /> |
| 266 | + </antcall> |
| 267 | + </limit> |
| 268 | + </sequential> |
| 269 | + </for> |
| 270 | + </else> |
| 271 | + </if> |
| 272 | + </target> |
| 273 | + |
| 274 | + <selector id="tests-to-run"> |
| 275 | + <and> |
| 276 | + <filename name="**/*${test-filter-string}*/**" /> |
| 277 | + <filename name="**/*Test.class" /> |
| 278 | + </and> |
| 279 | + </selector> |
| 280 | + |
| 281 | + <target name="do-test-15" depends="assert-15"> |
| 282 | + <echo message="Running all 5.0 tests matching '${test-filter-string}' under Java 5.0" /> |
230 | 283 | <junit haltonfailure="yes" fork="yes" forkmode="perTest" maxmemory="256M" dir="${basedir}"> |
231 | 284 | <classpath> |
232 | 285 | <pathelement location="lib/buildlib/junit.jar" /> |
|
237 | 290 | </classpath> |
238 | 291 | <formatter type="brief" usefile="false" /> |
239 | 292 | <batchtest> |
240 | | - <fileset dir="classes/test" includes="**/*${test-spec}*Test.class" /> |
| 293 | + <fileset dir="classes/test"> |
| 294 | + <selector refid="tests-to-run" /> |
| 295 | + </fileset> |
241 | 296 | </batchtest> |
242 | 297 | </junit> |
243 | | - |
244 | 298 | </target> |
245 | 299 |
|
246 | | - <target name="test-14" depends="compile-14, resolve-java14-exec" |
247 | | - description="Run all 1.4 tests under Java 1.4 (after compiling); use -Dtest-spec=... to filter"> |
| 300 | + <target name="do-test-14" depends="resolve-java14-exec"> |
248 | 301 | <echo message="Running all 1.4 tests matching '${test-spec}' under Java 1.4" /> |
249 | 302 | <junit haltonfailure="yes" fork="yes" forkmode="perTest" maxmemory="256M" jvm="${java14-exec}" dir="${basedir}"> |
250 | 303 | <classpath> |
|
256 | 309 | </classpath> |
257 | 310 | <formatter type="brief" usefile="false" /> |
258 | 311 | <batchtest> |
259 | | - <fileset dir="classes/test-14" includes="**/*${test-spec}*Test.class" /> |
| 312 | + <fileset dir="classes/test-14"> |
| 313 | + <selector refid="tests-to-run" /> |
| 314 | + </fileset> |
260 | 315 | </batchtest> |
261 | 316 | </junit> |
262 | 317 | </target> |
263 | 318 |
|
264 | | - <target name="test-14-in-15" depends="compile-14, assert-15" |
265 | | - description="Run all 1.4 tests under Java 5.0 (after compiling); use -Dtest-spec=... to filter"> |
| 319 | + <target name="do-test-14-in-15" depends="assert-15"> |
266 | 320 | <echo message="Running all 1.4 tests matching '${test-spec}' under Java 5.0" /> |
267 | 321 | <junit haltonfailure="yes" fork="yes" forkmode="perTest" maxmemory="256M" dir="${basedir}"> |
268 | 322 | <classpath> |
|
274 | 328 | </classpath> |
275 | 329 | <formatter type="brief" usefile="false" /> |
276 | 330 | <batchtest> |
277 | | - <fileset dir="classes/test-14" includes="**/*${test-spec}*Test.class" /> |
| 331 | + <fileset dir="classes/test-14"> |
| 332 | + <selector refid="tests-to-run" /> |
| 333 | + </fileset> |
278 | 334 | </batchtest> |
279 | 335 | </junit> |
280 | 336 | </target> |
|
0 commit comments