ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
(Generate patch)

Comparing jsr166/build.xml (file contents):
Revision 1.133 by jsr166, Sun Feb 3 02:16:08 2013 UTC vs.
Revision 1.142 by jsr166, Tue Jun 18 20:54:57 2013 UTC

# Line 44 | Line 44 | As of 2013-02, the very latest lambda 8
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"/>
# Line 170 | Line 179 | As of 2013-02, the very latest lambda 8
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=""/>
# Line 185 | Line 194 | As of 2013-02, the very latest lambda 8
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"/>
# Line 201 | Line 211 | As of 2013-02, the very latest lambda 8
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"/>
# Line 216 | Line 229 | As of 2013-02, the very latest lambda 8
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}"/>
# Line 268 | Line 309 | As of 2013-02, the very latest lambda 8
309    </target>
310  
311  
271  <target name="test"
272          depends="configure-tests, report-tests"
273          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
274
275
312    <target name="docs"
313            description="Builds javadocs for src/main to dist dir">
314  
# Line 339 | Line 375 | As of 2013-02, the very latest lambda 8
375    </target>
376  
377  
342  <!-- Internal targets -->
343
344
378    <target name="dist-jar"
379            depends="clean, jar">
380      <copy file="${product.jar}" todir="${dist.dir}"/>
# Line 353 | Line 386 | As of 2013-02, the very latest lambda 8
386    </target>
387  
388  
356  <target name="compile-tests"
357          depends="jar">
358
359    <mkdir dir="${build.testcases.dir}"/>
360
361    <javac srcdir="${tck.src.dir}"
362           destdir="${build.testcases.dir}"
363           debug="${build.debug}"
364           debuglevel="${build.debuglevel}"
365           deprecation="${build.deprecation}"
366           source="6"
367           classpath="${junit.jar}"
368           bootclasspath="@{product.jar}:${bootclasspath6}"
369           includeAntRuntime="false"
370           includeJavaRuntime="false"
371           executable="${javac8}"
372           fork="true">
373
374      <include name="**/*.java"/>
375      <compilerarg value="-XDignore.symbol.file=true"/>
376      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
377      <compilerarg line="${build.args}"/>
378
379    </javac>
380
381    <javac srcdir="${test.src.dir}"
382           destdir="${build.testcases.dir}"
383           debug="${build.debug}"
384           debuglevel="${build.debuglevel}"
385           deprecation="${build.deprecation}"
386           source="6"
387           classpath=""
388           bootclasspath="@{product.jar}:${bootclasspath6}"
389           includeAntRuntime="false"
390           includeJavaRuntime="false"
391           executable="${javac8}"
392           fork="true">
393
394      <include name="jsr166/test/**/*.java"/>
395      <compilerarg value="-XDignore.symbol.file=true"/>
396      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
397      <compilerarg line="${build.args}"/>
398
399    </javac>
400
401 <!--
402    <javac srcdir="${jtreg.src.dir}"
403          destdir="${build.testcases.dir}"
404            debug="${build.debug}"
405       debuglevel="${build.debuglevel}"
406      deprecation="${build.deprecation}"
407           source="${build.sourcelevel}"
408             fork="true">
409
410      <compilerarg value="-Xbootclasspath/p:${product.jar}"/>
411      <compilerarg value="-XDignore.symbol.file=true"/>
412      <compilerarg line="${build.args}"/>
413
414    </javac>
415 -->
416
417  </target>
418
389    <target name="test-tck"
390            depends="jar"
391            description="Runs tck tests for main directly">
# Line 426 | Line 396 | As of 2013-02, the very latest lambda 8
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}"/>
436 <
437 <    <junit printsummary="true"
438 <             showoutput="true"
439 <          errorProperty="junit.failed"
440 <        failureProperty="junit.failed"
441 <                    dir="${build.reports.dir}"
442 <                    jvm="${java8}"
443 <                   fork="true">
444 <
445 <      <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
446 <      <jvmarg value="-server"/>
447 <      <jvmarg value="-showversion"/>
448 <
449 <      <classpath refid="test.classpath"/>
450 <
451 <      <formatter type="xml"/>
452 <
453 <      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
454 <        <fileset dir="${tck.src.dir}">
455 <          <include name="**/${testcase}Test.java"/>
456 <        </fileset>
457 <      </batchtest>
458 <
459 <      <batchtest todir="${build.reports.dir}" if="do.test.old">
460 <        <fileset dir="${test.src.dir}">
461 <          <include name="jsr166/test/**/${testcase}Test.java"/>
462 <        </fileset>
463 <      </batchtest>
464 <
465 < <!--
466 <      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
467 <        <fileset dir="${jtreg.src.dir}">
468 <          <include name="**/${testcase}Test.java"/>
469 <        </fileset>
470 <      </batchtest>
471 < -->
472 <
473 <    </junit>
474 <
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">
480 <
481 <    <!-- Sets junit.report.format to frames if redirection is present,
482 <         otherwise sets it to noframes. -->
483 <    <available property="junit.report.format"
484 <                  value="frames"
485 <              classname="org.apache.xalan.lib.Redirect"
486 <    />
487 <    <property name="junit.report.format" value="noframes"/>
488 <
489 <    <junitreport todir="${build.reports.dir}">
490 <      <fileset dir="${build.reports.dir}">
491 <        <include name="TEST-*.xml"/>
492 <      </fileset>
493 <      <report format="${junit.report.format}" todir="${build.reports.dir}"
494 <      />
495 <    </junitreport>
496 <
497 <    <fail message="Test Cases Failed" if="junit.failed"/>
498 <
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"/>
# Line 516 | Line 429 | As of 2013-02, the very latest lambda 8
429    </target>
430  
431  
519  <target name="configure-tests"
520       depends="configure-compiler">
521
522    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
523    <available property="junit.available"
524               classname="junit.framework.Protectable"/>
525
526    <!-- Xalan -->
527    <available property="xalan.available"
528               classname="org.apache.xalan.Version"/>
529
530
531    <!-- Ant 1.6beta and later don't need or want this check -->
532    <!--
533    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
534          unless="junit.available"/>
535
536    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
537          unless="xalan.available"/>
538    -->
539
540  </target>
541
432  
433    <!-- Various demos and test programs -->
434  
# Line 620 | Line 510 | As of 2013-02, the very latest lambda 8
510        workdir="${build.4jdk7.dir}"
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>
# Line 648 | Line 545 | As of 2013-02, the very latest lambda 8
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}"
665 <           jdk="${jdk7.home}"
666 <           workDir="${build.4jdk7.dir}/JTwork"
667 <           reportDir="${build.4jdk7.dir}/JTreport">
668 <
669 <      <arg value="-Xbootclasspath/p:${4jdk7product.jar}"/>
670 <      <arg value="-agentvm"/>
671 <      <arg value="-v:nopass,fail"/>
672 <      <arg value="-vmoptions:-esa -ea"/>
673 <      <arg value="-automatic"/>
674 <      <arg value="-k:!ignore"/>
675 <    </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  
# Line 1070 | Line 956 | As of 2013-02, the very latest lambda 8
956  
957      <run-tck-tests
958        tck.src.dir="${test.src.dir}/tck-jsr166e"
959 <      source="7"
1074 <      target="8"
959 >      target="7"
960        workdir="${build.jsr166e.dir}"
961        classes="${jsr166e.jar}"/>
962    </target>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines