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