|
47 | 47 | <property name="javacc-home" value="${env.JAVACC_HOME}" /> |
48 | 48 | <property name="clover-jar" value="${env.CLOVER_JAR}" /> |
49 | 49 |
|
50 | | - |
51 | | - <!-- By default, don't filter tests on anything --> |
| 50 | + <!-- Testing defaults --> |
52 | 51 | <property name="test-spec" value="" /> |
| 52 | + <property name="test-repeat" value="1" /> <!-- TODO: Use this value --> |
| 53 | + <property name="test-timeout" value="1440" /> |
53 | 54 |
|
54 | 55 | <!-- By default, clean can fail --> |
55 | 56 | <property name="clean-can-fail" value="yes" /> |
|
79 | 80 | <taskdef resource="com/cenqua/ant/antlib.xml" classpath="lib/buildlib/cenquatasks.jar" /> |
80 | 81 | <extendclasspath path="lib/buildlib/junit.jar" /> |
81 | 82 |
|
| 83 | + <!-- Extension containing various tools, including "for" and "if" --> |
| 84 | + <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="lib/buildlib/ant-contrib.jar"/> |
82 | 85 |
|
83 | 86 | <!-- *********** |
84 | 87 | Help Target |
|
424 | 427 | <target name="test" depends="test-15" description="Shortcut for 'test-15'"> |
425 | 428 | </target> |
426 | 429 |
|
427 | | - |
428 | | - <target name="test-15" depends="compile-15, assert-15" |
| 430 | + <target name="test-15" depends="compile-15" |
429 | 431 | description="Run all 5.0 tests under Java 5.0 (after compiling); use -Dtest-spec=... to filter"> |
430 | | - <echo message="Running all 5.0 tests matching '${test-spec}' under Java 5.0" /> |
| 432 | + <antcall target="iterate-tests"> |
| 433 | + <param name="do-test-target" value="do-test-15" /> |
| 434 | + </antcall> |
| 435 | + </target> |
| 436 | + |
| 437 | + <target name="test-14" depends="compile-14" |
| 438 | + description="Run all 1.4 tests under Java 1.4 (after compiling); use -Dtest-spec=... to filter"> |
| 439 | + <antcall target="iterate-tests"> |
| 440 | + <param name="do-test-target" value="do-test-14" /> |
| 441 | + </antcall> |
| 442 | + </target> |
| 443 | + |
| 444 | + <target name="test-14-in-15" depends="compile-14, assert-15" |
| 445 | + description="Run all 1.4 tests under Java 5.0 (after compiling); use -Dtest-spec=... to filter"> |
| 446 | + <antcall target="iterate-tests"> |
| 447 | + <param name="do-test-target" value="do-test-14-in-15" /> |
| 448 | + </antcall> |
| 449 | + </target> |
| 450 | + |
| 451 | + <target name="iterate-tests"> |
| 452 | + <if> |
| 453 | + <equals arg1="${test-spec}" arg2="" /> |
| 454 | + <then> |
| 455 | + <limit minutes="${test-timeout}" failonerror="true"> |
| 456 | + <antcall target="${do-test-target}"> |
| 457 | + <param name="test-filter-string" value="" /> |
| 458 | + </antcall> |
| 459 | + </limit> |
| 460 | + </then> |
| 461 | + <else> |
| 462 | + <for list="${test-spec}" param="test-filter-string-attribute"> |
| 463 | + <sequential> |
| 464 | + <limit minutes="${test-timeout}" failonerror="true"> |
| 465 | + <antcall target="${do-test-target}"> |
| 466 | + <param name="test-filter-string" value="@{test-filter-string-attribute}" /> |
| 467 | + </antcall> |
| 468 | + </limit> |
| 469 | + </sequential> |
| 470 | + </for> |
| 471 | + </else> |
| 472 | + </if> |
| 473 | + </target> |
| 474 | + |
| 475 | + <selector id="tests-to-run"> |
| 476 | + <and> |
| 477 | + <filename name="**/*${test-filter-string}*/**" /> |
| 478 | + <filename name="**/*Test.class" /> |
| 479 | + </and> |
| 480 | + </selector> |
| 481 | + |
| 482 | + <target name="do-test-15" depends="assert-15"> |
| 483 | + <echo message="Running all 5.0 tests matching '${test-filter-string}' under Java 5.0" /> |
431 | 484 | <junit haltonfailure="yes" fork="yes" forkmode="perTest" maxmemory="256M" dir="${basedir}"> |
432 | 485 | <classpath> |
433 | 486 | <pathelement location="lib/buildlib/junit.jar" /> |
|
439 | 492 | </classpath> |
440 | 493 | <formatter type="brief" usefile="false" /> |
441 | 494 | <batchtest> |
442 | | - <fileset dir="classes/test" includes="**/*${test-spec}*Test.class" /> |
| 495 | + <fileset dir="classes/test"> |
| 496 | + <selector refid="tests-to-run" /> |
| 497 | + </fileset> |
443 | 498 | </batchtest> |
444 | 499 | </junit> |
445 | | - |
446 | 500 | </target> |
447 | 501 |
|
448 | | - <target name="test-14" depends="compile-14, resolve-java14-exec" |
449 | | - description="Run all 1.4 tests under Java 1.4 (after compiling); use -Dtest-spec=... to filter"> |
| 502 | + <target name="do-test-14" depends="resolve-java14-exec"> |
450 | 503 | <echo message="Running all 1.4 tests matching '${test-spec}' under Java 1.4" /> |
451 | 504 | <junit haltonfailure="yes" fork="yes" forkmode="perTest" maxmemory="256M" jvm="${java14-exec}" dir="${basedir}"> |
452 | 505 | <classpath> |
|
459 | 512 | </classpath> |
460 | 513 | <formatter type="brief" usefile="false" /> |
461 | 514 | <batchtest> |
462 | | - <fileset dir="classes/test-14" includes="**/*${test-spec}*Test.class" /> |
| 515 | + <fileset dir="classes/test-14"> |
| 516 | + <selector refid="tests-to-run" /> |
| 517 | + </fileset> |
463 | 518 | </batchtest> |
464 | 519 | </junit> |
465 | 520 | </target> |
466 | 521 |
|
467 | | - <target name="test-14-in-15" depends="compile-14, assert-15" |
468 | | - description="Run all 1.4 tests under Java 5.0 (after compiling); use -Dtest-spec=... to filter"> |
| 522 | + <target name="do-test-14-in-15" depends="assert-15"> |
469 | 523 | <echo message="Running all 1.4 tests matching '${test-spec}' under Java 5.0" /> |
470 | 524 | <junit haltonfailure="yes" fork="yes" forkmode="perTest" maxmemory="256M" dir="${basedir}"> |
471 | 525 | <classpath> |
|
478 | 532 | </classpath> |
479 | 533 | <formatter type="brief" usefile="false" /> |
480 | 534 | <batchtest> |
481 | | - <fileset dir="classes/test-14" includes="**/*${test-spec}*Test.class" /> |
| 535 | + <fileset dir="classes/test-14"> |
| 536 | + <selector refid="tests-to-run" /> |
| 537 | + </fileset> |
482 | 538 | </batchtest> |
483 | 539 | </junit> |
484 | 540 | </target> |
|
0 commit comments