44 |
|
<property name="build.deprecation" value="false"/> |
45 |
|
<property name="build.javadoc.access" value="protected"/> |
46 |
|
|
47 |
+ |
<!-- Tck options; see JSR166TestCase.java --> |
48 |
+ |
<!-- ant -Djsr166.profileTests=true -Djsr166.runsPerTest=100 test-tck --> |
49 |
+ |
<property name="jsr166.profileTests" value="false"/> |
50 |
+ |
<property name="jsr166.profileThreshold" value="100"/> |
51 |
+ |
<property name="jsr166.runsPerTest" value="1"/> |
52 |
+ |
<!-- Allow running an individual tck test class --> |
53 |
+ |
<!-- ant -Djsr166.tckTestClass=CountedCompleterTest -Djsr166.runsPerTest=100 test-tck --> |
54 |
+ |
<property name="jsr166.tckTestClass" value="JSR166TestCase"/> |
55 |
+ |
|
56 |
|
<!-- Build locations --> |
57 |
|
<property name="build.dir" location="build"/> |
58 |
|
<property name="build.classes.dir" location="${build.dir}/classes"/> |
179 |
|
|
180 |
|
<macrodef name="run-tck-tests"> |
181 |
|
<attribute name="tck.src.dir" default="${tck.src.dir}"/> |
173 |
– |
<attribute name="source" default="6"/> |
182 |
|
<attribute name="target"/> |
183 |
+ |
<attribute name="compile-target" default="@{target}"/> |
184 |
|
<attribute name="workdir"/> |
185 |
|
<attribute name="classes"/> |
186 |
|
<attribute name="jvmflags" default=""/> |
187 |
+ |
<element name="javac-elements" optional="true"/> |
188 |
|
<sequential> |
189 |
|
|
190 |
|
<mkdir dir="@{workdir}/tck-classes"/> |
194 |
|
debug="${build.debug}" |
195 |
|
debuglevel="${build.debuglevel}" |
196 |
|
deprecation="${build.deprecation}" |
197 |
< |
source="@{source}" |
197 |
> |
source="@{compile-target}" |
198 |
> |
target="@{compile-target}" |
199 |
|
classpath="${junit.jar}" |
200 |
< |
bootclasspath="@{classes}:${bootclasspath@{source}}" |
200 |
> |
bootclasspath="@{classes}:${bootclasspath@{compile-target}}" |
201 |
|
includeAntRuntime="false" |
202 |
|
includeJavaRuntime="false" |
203 |
< |
executable="${javac@{target}}" |
203 |
> |
executable="${javac@{compile-target}}" |
204 |
|
fork="true"> |
205 |
|
|
206 |
|
<include name="*.java"/> |
207 |
|
<compilerarg value="-XDignore.symbol.file=true"/> |
208 |
|
<compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/> |
209 |
|
<compilerarg line="${build.args}"/> |
210 |
+ |
<javac-elements/> |
211 |
|
|
212 |
|
</javac> |
213 |
|
|
214 |
< |
<java classname="JSR166TestCase" |
214 |
> |
<java classname="${jsr166.tckTestClass}" |
215 |
|
failonerror="true" |
216 |
|
jvm="${java@{target}}" |
217 |
|
fork="true"> |
218 |
|
<jvmarg value="-Xbootclasspath/p:@{classes}"/> |
219 |
|
<jvmarg line="@{jvmflags}"/> |
220 |
+ |
<sysproperty key="jsr166.profileTests" value="${jsr166.profileTests}"/> |
221 |
+ |
<sysproperty key="jsr166.profileThreshold" value="${jsr166.profileThreshold}"/> |
222 |
+ |
<sysproperty key="jsr166.runsPerTest" value="${jsr166.runsPerTest}"/> |
223 |
|
<classpath> |
224 |
|
<pathelement location="${junit.jar}"/> |
225 |
|
<pathelement location="@{workdir}/tck-classes"/> |
229 |
|
</sequential> |
230 |
|
</macrodef> |
231 |
|
|
232 |
+ |
<macrodef name="run-jtreg-tests"> |
233 |
+ |
<attribute name="jtreg.src.dir" default="${jtreg.src.dir}"/> |
234 |
+ |
<attribute name="source" default="7"/> |
235 |
+ |
<attribute name="target"/> |
236 |
+ |
<attribute name="workdir"/> |
237 |
+ |
<attribute name="classes"/> |
238 |
+ |
<attribute name="jtregflags" default=""/> |
239 |
+ |
<sequential> |
240 |
+ |
<delete dir="@{workdir}/JTwork" quiet="true"/> |
241 |
+ |
<delete dir="@{workdir}/JTreport" quiet="true"/> |
242 |
+ |
<mkdir dir="@{workdir}/JTwork/scratch"/> |
243 |
+ |
<mkdir dir="@{workdir}/JTreport"/> |
244 |
+ |
<jtreg dir="@{jtreg.src.dir}" |
245 |
+ |
jdk="${jdk@{target}.home}" |
246 |
+ |
workDir="@{workdir}/JTwork" |
247 |
+ |
reportDir="@{workdir}/JTreport"> |
248 |
+ |
|
249 |
+ |
<arg value="-Xbootclasspath/p:@{classes}"/> |
250 |
+ |
<arg value="-agentvm"/> |
251 |
+ |
<arg value="-v:nopass,fail"/> |
252 |
+ |
<arg value="-vmoptions:-esa -ea"/> |
253 |
+ |
<arg value="-automatic"/> |
254 |
+ |
<arg value="-k:!ignore"/> |
255 |
+ |
<arg line="@{jtregflags}"/> |
256 |
+ |
</jtreg> |
257 |
+ |
</sequential> |
258 |
+ |
</macrodef> |
259 |
+ |
|
260 |
|
<!-- ALoops classpath --> |
261 |
|
<path id="loops.classpath"> |
262 |
|
<pathelement location="${build.loops.dir}"/> |
290 |
|
fork="true"> |
291 |
|
|
292 |
|
<include name="**/*.java"/> |
293 |
+ |
<compilerarg value="-Xprefer:source"/> |
294 |
|
<compilerarg value="-XDignore.symbol.file=true"/> |
295 |
|
<compilerarg value="-Xlint:all"/> |
296 |
|
<compilerarg line="${build.args}"/> |
309 |
|
</target> |
310 |
|
|
311 |
|
|
268 |
– |
<target name="test" |
269 |
– |
depends="configure-tests, report-tests" |
270 |
– |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
271 |
– |
|
272 |
– |
|
312 |
|
<target name="docs" |
313 |
|
description="Builds javadocs for src/main to dist dir"> |
314 |
|
|
375 |
|
</target> |
376 |
|
|
377 |
|
|
339 |
– |
<!-- Internal targets --> |
340 |
– |
|
341 |
– |
|
378 |
|
<target name="dist-jar" |
379 |
|
depends="clean, jar"> |
380 |
|
<copy file="${product.jar}" todir="${dist.dir}"/> |
386 |
|
</target> |
387 |
|
|
388 |
|
|
353 |
– |
<target name="compile-tests" |
354 |
– |
depends="jar"> |
355 |
– |
|
356 |
– |
<mkdir dir="${build.testcases.dir}"/> |
357 |
– |
|
358 |
– |
<javac srcdir="${tck.src.dir}" |
359 |
– |
destdir="${build.testcases.dir}" |
360 |
– |
debug="${build.debug}" |
361 |
– |
debuglevel="${build.debuglevel}" |
362 |
– |
deprecation="${build.deprecation}" |
363 |
– |
source="6" |
364 |
– |
classpath="${junit.jar}" |
365 |
– |
bootclasspath="@{product.jar}:${bootclasspath6}" |
366 |
– |
includeAntRuntime="false" |
367 |
– |
includeJavaRuntime="false" |
368 |
– |
executable="${javac8}" |
369 |
– |
fork="true"> |
370 |
– |
|
371 |
– |
<include name="**/*.java"/> |
372 |
– |
<compilerarg value="-XDignore.symbol.file=true"/> |
373 |
– |
<compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/> |
374 |
– |
<compilerarg line="${build.args}"/> |
375 |
– |
|
376 |
– |
</javac> |
377 |
– |
|
378 |
– |
<javac srcdir="${test.src.dir}" |
379 |
– |
destdir="${build.testcases.dir}" |
380 |
– |
debug="${build.debug}" |
381 |
– |
debuglevel="${build.debuglevel}" |
382 |
– |
deprecation="${build.deprecation}" |
383 |
– |
source="6" |
384 |
– |
classpath="" |
385 |
– |
bootclasspath="@{product.jar}:${bootclasspath6}" |
386 |
– |
includeAntRuntime="false" |
387 |
– |
includeJavaRuntime="false" |
388 |
– |
executable="${javac8}" |
389 |
– |
fork="true"> |
390 |
– |
|
391 |
– |
<include name="jsr166/test/**/*.java"/> |
392 |
– |
<compilerarg value="-XDignore.symbol.file=true"/> |
393 |
– |
<compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/> |
394 |
– |
<compilerarg line="${build.args}"/> |
395 |
– |
|
396 |
– |
</javac> |
397 |
– |
|
398 |
– |
<!-- |
399 |
– |
<javac srcdir="${jtreg.src.dir}" |
400 |
– |
destdir="${build.testcases.dir}" |
401 |
– |
debug="${build.debug}" |
402 |
– |
debuglevel="${build.debuglevel}" |
403 |
– |
deprecation="${build.deprecation}" |
404 |
– |
source="${build.sourcelevel}" |
405 |
– |
fork="true"> |
406 |
– |
|
407 |
– |
<compilerarg value="-Xbootclasspath/p:${product.jar}"/> |
408 |
– |
<compilerarg value="-XDignore.symbol.file=true"/> |
409 |
– |
<compilerarg line="${build.args}"/> |
410 |
– |
|
411 |
– |
</javac> |
412 |
– |
--> |
413 |
– |
|
414 |
– |
</target> |
415 |
– |
|
389 |
|
<target name="test-tck" |
390 |
|
depends="jar" |
391 |
|
description="Runs tck tests for main directly"> |
396 |
|
classes="${product.jar}"/> |
397 |
|
</target> |
398 |
|
|
399 |
< |
<target name="run-tests" |
400 |
< |
depends="compile-tests"> |
401 |
< |
|
402 |
< |
<!-- May be overridden by user.properties --> |
403 |
< |
<property name="testcase" value="*"/> |
404 |
< |
|
405 |
< |
<mkdir dir="${build.reports.dir}"/> |
433 |
< |
|
434 |
< |
<junit printsummary="true" |
435 |
< |
showoutput="true" |
436 |
< |
errorProperty="junit.failed" |
437 |
< |
failureProperty="junit.failed" |
438 |
< |
dir="${build.reports.dir}" |
439 |
< |
jvm="${java8}" |
440 |
< |
fork="true"> |
441 |
< |
|
442 |
< |
<jvmarg value="-Xbootclasspath/p:${product.jar}"/> |
443 |
< |
<jvmarg value="-server"/> |
444 |
< |
<jvmarg value="-showversion"/> |
445 |
< |
|
446 |
< |
<classpath refid="test.classpath"/> |
447 |
< |
|
448 |
< |
<formatter type="xml"/> |
449 |
< |
|
450 |
< |
<batchtest todir="${build.reports.dir}" unless="no.test.tck"> |
451 |
< |
<fileset dir="${tck.src.dir}"> |
452 |
< |
<include name="**/${testcase}Test.java"/> |
453 |
< |
</fileset> |
454 |
< |
</batchtest> |
455 |
< |
|
456 |
< |
<batchtest todir="${build.reports.dir}" if="do.test.old"> |
457 |
< |
<fileset dir="${test.src.dir}"> |
458 |
< |
<include name="jsr166/test/**/${testcase}Test.java"/> |
459 |
< |
</fileset> |
460 |
< |
</batchtest> |
461 |
< |
|
462 |
< |
<!-- |
463 |
< |
<batchtest todir="${build.reports.dir}" if="do.test.jtreg"> |
464 |
< |
<fileset dir="${jtreg.src.dir}"> |
465 |
< |
<include name="**/${testcase}Test.java"/> |
466 |
< |
</fileset> |
467 |
< |
</batchtest> |
468 |
< |
--> |
469 |
< |
|
470 |
< |
</junit> |
471 |
< |
|
399 |
> |
<target name="test-jtreg" |
400 |
> |
depends="jar" |
401 |
> |
description="Runs jtreg tests for main using the jtreg ant task"> |
402 |
> |
<run-jtreg-tests |
403 |
> |
target="8" |
404 |
> |
workdir="${build.dir}" |
405 |
> |
classes="${product.jar}"/> |
406 |
|
</target> |
407 |
|
|
408 |
< |
|
409 |
< |
<target name="report-tests" |
410 |
< |
depends="run-tests"> |
477 |
< |
|
478 |
< |
<!-- Sets junit.report.format to frames if redirection is present, |
479 |
< |
otherwise sets it to noframes. --> |
480 |
< |
<available property="junit.report.format" |
481 |
< |
value="frames" |
482 |
< |
classname="org.apache.xalan.lib.Redirect" |
483 |
< |
/> |
484 |
< |
<property name="junit.report.format" value="noframes"/> |
485 |
< |
|
486 |
< |
<junitreport todir="${build.reports.dir}"> |
487 |
< |
<fileset dir="${build.reports.dir}"> |
488 |
< |
<include name="TEST-*.xml"/> |
489 |
< |
</fileset> |
490 |
< |
<report format="${junit.report.format}" todir="${build.reports.dir}" |
491 |
< |
/> |
492 |
< |
</junitreport> |
493 |
< |
|
494 |
< |
<fail message="Test Cases Failed" if="junit.failed"/> |
495 |
< |
|
408 |
> |
<target name="test" |
409 |
> |
depends="test-tck, test-jtreg" |
410 |
> |
description="Runs tck and jtreg tests for main"> |
411 |
|
</target> |
412 |
|
|
413 |
|
|
414 |
+ |
|
415 |
|
<target name="configure-compiler"> |
416 |
|
|
417 |
|
<property name="unchecked.option" value="-Xlint:unchecked"/> |
429 |
|
</target> |
430 |
|
|
431 |
|
|
516 |
– |
<target name="configure-tests" |
517 |
– |
depends="configure-compiler"> |
518 |
– |
|
519 |
– |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
520 |
– |
<available property="junit.available" |
521 |
– |
classname="junit.framework.Protectable"/> |
522 |
– |
|
523 |
– |
<!-- Xalan --> |
524 |
– |
<available property="xalan.available" |
525 |
– |
classname="org.apache.xalan.Version"/> |
526 |
– |
|
527 |
– |
|
528 |
– |
<!-- Ant 1.6beta and later don't need or want this check --> |
529 |
– |
<!-- |
530 |
– |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
531 |
– |
unless="junit.available"/> |
532 |
– |
|
533 |
– |
<fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests" |
534 |
– |
unless="xalan.available"/> |
535 |
– |
--> |
536 |
– |
|
537 |
– |
</target> |
538 |
– |
|
432 |
|
|
433 |
|
<!-- Various demos and test programs --> |
434 |
|
|
481 |
|
fork="true"> |
482 |
|
|
483 |
|
<include name="**/*.java"/> |
484 |
+ |
<compilerarg value="-Xprefer:source"/> |
485 |
|
<compilerarg value="-XDignore.symbol.file=true"/> |
486 |
|
<compilerarg value="-Xlint:all"/> |
487 |
|
<compilerarg line="${build.args}"/> |
508 |
|
<run-tck-tests |
509 |
|
target="7" |
510 |
|
workdir="${build.4jdk7.dir}" |
511 |
< |
classes="${4jdk7product.jar}"/> |
511 |
> |
classes="${4jdk7product.jar}"> |
512 |
> |
<javac-elements> |
513 |
> |
<!-- JDK8+ test classes --> |
514 |
> |
<exclude name="*8Test.java"/> |
515 |
> |
<exclude name="DoubleAccumulatorTest.java"/> |
516 |
> |
<exclude name="DoubleAdderTest.java"/> |
517 |
> |
<exclude name="LongAccumulatorTest.java"/> |
518 |
> |
<exclude name="LongAdderTest.java"/> |
519 |
> |
<exclude name="CompletableFutureTest.java"/> |
520 |
> |
<exclude name="StampedLockTest.java"/> |
521 |
> |
</javac-elements> |
522 |
> |
</run-tck-tests> |
523 |
|
</target> |
524 |
|
|
525 |
|
|
545 |
|
|
546 |
|
<formatter type="brief"/> |
547 |
|
|
548 |
< |
<test name="JSR166TestCase" haltonfailure="no"> |
548 |
> |
<test name="${jsr166.tckTestClass}" haltonfailure="no"> |
549 |
|
</test> |
550 |
|
|
551 |
|
</junit> |
552 |
|
</target> |
553 |
|
|
554 |
|
<target name="4jdk7-test-jtreg" |
555 |
< |
depends="4jdk7compile" |
555 |
> |
depends="4jdk7jar" |
556 |
|
description="Runs jtreg tests for jsr166-4jdk7 using the jtreg ant task"> |
557 |
< |
<delete dir="${build.4jdk7.dir}/JTwork" quiet="true"/> |
558 |
< |
<delete dir="${build.4jdk7.dir}/JTreport" quiet="true"/> |
559 |
< |
<mkdir dir="${build.4jdk7.dir}/JTwork/scratch"/> |
560 |
< |
<mkdir dir="${build.4jdk7.dir}/JTreport"/> |
561 |
< |
<jtreg dir="${jtreg.src.dir}" |
657 |
< |
jdk="${jdk7.home}" |
658 |
< |
workDir="${build.4jdk7.dir}/JTwork" |
659 |
< |
reportDir="${build.4jdk7.dir}/JTreport"> |
660 |
< |
|
661 |
< |
<arg value="-Xbootclasspath/p:${4jdk7product.jar}"/> |
662 |
< |
<arg value="-agentvm"/> |
663 |
< |
<arg value="-v:nopass,fail"/> |
664 |
< |
<arg value="-vmoptions:-esa -ea"/> |
665 |
< |
<arg value="-automatic"/> |
666 |
< |
<arg value="-k:!ignore"/> |
667 |
< |
</jtreg> |
557 |
> |
<run-jtreg-tests |
558 |
> |
target="7" |
559 |
> |
workdir="${build.4jdk7.dir}" |
560 |
> |
classes="${4jdk7product.jar}" |
561 |
> |
jtregflags="-exclude:${jtreg.src.dir}/jdk8tests"/> |
562 |
|
</target> |
563 |
|
|
564 |
|
|
956 |
|
|
957 |
|
<run-tck-tests |
958 |
|
tck.src.dir="${test.src.dir}/tck-jsr166e" |
959 |
< |
source="7" |
1066 |
< |
target="8" |
959 |
> |
target="7" |
960 |
|
workdir="${build.jsr166e.dir}" |
961 |
|
classes="${jsr166e.jar}"/> |
962 |
|
</target> |