< prev index next >

make/build.xml

Print this page




 377     <!-- tests that check nashorn internals and internal API -->
 378     <jar jarfile="${nashorn.internal.tests.jar}">
 379       <fileset dir="${build.test.classes.dir}" includes="**/internal/**"/>
 380       <fileset dir="${build.test.classes.dir}" includes="**/test/tools/**"/>
 381       <fileset dir="${build.test.classes.dir}" includes="**/models/**"/>
 382       <fileset dir="${build.test.classes.dir}" includes="**/jdk/dynalink/test/Trusted**"/>
 383       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
 384     </jar>
 385 
 386     <!-- tests that check nashorn script engine (jsr-223) API and dynalink API -->
 387     <jar jarfile="${nashorn.api.tests.jar}">
 388       <fileset dir="${build.test.classes.dir}" includes="**/jdk/dynalink/**" excludes="**/jdk/dynalink/test/Trusted**"/>
 389       <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
 390       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
 391       <fileset dir="${build.test.classes.dir}" includes="**/resources/*.js"/>
 392       <fileset dir="${build.test.classes.dir}" includes="**/UnnamedPackage**"/>
 393     </jar>
 394 
 395   </target>
 396 












 397   <target name="generate-policy-file" depends="prepare">
 398     <echo file="${build.dir}/nashorn.policy">
 399 
 400 grant codeBase "file:/${basedir}/${dynalink.module.classes.dir}" {
 401     permission java.security.AllPermission;
 402 };
 403 
 404 grant codeBase "file:/${basedir}/${nashorn.module.classes.dir}" {
 405     permission java.security.AllPermission;
 406 };
 407 
 408 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
 409     permission java.security.AllPermission;
 410 };
 411 
 412 grant codeBase "file:/${basedir}/${nashorn.api.tests.jar}" {
 413     permission java.util.PropertyPermission "parserapitest.*", "read";
 414     permission java.util.PropertyPermission "test.*", "read";
 415     permission java.util.PropertyPermission "test262.*", "read";
 416     permission java.io.FilePermission "${basedir}/test/-","read";


 583             verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 584       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 585       <jvmarg line="${debug.test.jvmargs}"/>
 586       <propertyset>
 587         <propertyref prefix="nashorn."/>
 588       </propertyset>
 589       <propertyset>
 590         <propertyref prefix="test-sys-prop."/>
 591         <mapper from="test-sys-prop.*" to="*" type="glob"/>
 592       </propertyset>
 593       <sysproperty key="optimistic.override" value="${optimistic}"/>
 594       <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
 595       <classpath>
 596           <pathelement path="${run.test.classpath}"/>
 597       </classpath>
 598     </testng>
 599   </target>
 600 
 601   <target name="test" depends="prepare, javadoc, test-pessimistic, test-optimistic"/>
 602 
 603   <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 604     <echo message="Running test suite in OPTIMISTIC mode..."/>
 605     <antcall target="-test-nosecurity" inheritRefs="true">
 606       <param name="optimistic" value="true"/>
 607       <param name="testResultsSubDir" value="optimistic"/>
 608     </antcall>
 609     <antcall target="-test-security" inheritRefs="true">
 610       <param name="optimistic" value="true"/>
 611       <param name="testResultsSubDir" value="optimistic"/>
 612     </antcall>
 613   </target>
 614 
 615   <target name="test-pessimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 616     <echo message="Running test suite in PESSIMISTIC mode..."/>
 617     <antcall target="-test-nosecurity" inheritRefs="true">
 618       <param name="optimistic" value="false"/>
 619       <param name="testResultsSubDir" value="pessimistic"/>
 620     </antcall>
 621     <antcall target="-test-security" inheritRefs="true">
 622       <param name="optimistic" value="false"/>
 623       <param name="testResultsSubDir" value="pessimistic"/>
 624     </antcall>
 625   </target>
 626 
 627   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
 628     <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy TestNG and dependency JARs, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar to the test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
 629   </target>
 630 
 631   <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
 632     <fileset id="test.classes" dir="${build.test.classes.dir}">
 633        <include name="**/framework/*Test.class"/>
 634     </fileset>
 635 


 638     <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
 639         <not>
 640             <os family="mac"/>
 641         </not>
 642     </condition>
 643 
 644     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 645        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 646       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
 647       <propertyset>
 648         <propertyref prefix="testjfx-test-sys-prop."/>
 649         <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
 650       </propertyset>
 651       <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
 652       <classpath>
 653           <pathelement path="${testjfx.run.test.classpath}"/>
 654       </classpath>
 655     </testng>
 656   </target>
 657 
 658   <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 659     <fileset id="test.classes" dir="${build.test.classes.dir}">
 660        <include name="**/framework/*Test.class"/>
 661     </fileset>
 662 
 663     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 664        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 665       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 666       <propertyset>
 667         <propertyref prefix="testmarkdown-test-sys-prop."/>
 668         <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
 669       </propertyset>
 670       <classpath>
 671           <pathelement path="${run.test.classpath}"/>
 672       </classpath>
 673     </testng>
 674   </target>
 675 
 676   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 677     <fileset id="test.classes" dir="${build.test.classes.dir}">
 678        <include name="**/framework/*Test.class"/>
 679     </fileset>
 680 
 681     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 682        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 683       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 684       <propertyset>
 685         <propertyref prefix="nashorn."/>
 686       </propertyset>
 687       <propertyset>
 688         <propertyref prefix="test262-test-sys-prop."/>
 689         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
 690       </propertyset>
 691       <classpath>
 692           <pathelement path="${run.test.classpath}"/>
 693       </classpath>
 694     </testng>
 695   </target>
 696 
 697   <target name="test262parallel" depends="test262-parallel"/>
 698 
 699   <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 700     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
 701     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true" failonerror="true">
 702       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 703       <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
 704       <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
 705       <classpath>
 706           <pathelement path="${run.test.classpath}"/>
 707       </classpath>
 708       <syspropertyset>
 709           <propertyref prefix="test262-test-sys-prop."/>
 710           <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
 711       </syspropertyset>
 712     </java>
 713   </target>
 714 
 715   <target name="testparallel" depends="test-parallel"/>
 716 
 717   <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 718       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
 719       <java classname="${parallel.test.runner}" dir="${basedir}"
 720         failonerror="true"
 721         fork="true">
 722       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 723       <classpath>
 724           <pathelement path="${run.test.classpath}"/>
 725       <pathelement path="${build.test.classes.dir}"/>
 726       </classpath>
 727       <syspropertyset>
 728           <propertyref prefix="test-sys-prop."/>
 729           <mapper type="glob" from="test-sys-prop.*" to="*"/>
 730       </syspropertyset>
 731       </java>
 732   </target>
 733 
 734   <target name="all" depends="test, docs"
 735       description="Build, test and generate docs for nashorn"/>
 736 
 737   <target name="run" depends="jar"




 377     <!-- tests that check nashorn internals and internal API -->
 378     <jar jarfile="${nashorn.internal.tests.jar}">
 379       <fileset dir="${build.test.classes.dir}" includes="**/internal/**"/>
 380       <fileset dir="${build.test.classes.dir}" includes="**/test/tools/**"/>
 381       <fileset dir="${build.test.classes.dir}" includes="**/models/**"/>
 382       <fileset dir="${build.test.classes.dir}" includes="**/jdk/dynalink/test/Trusted**"/>
 383       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
 384     </jar>
 385 
 386     <!-- tests that check nashorn script engine (jsr-223) API and dynalink API -->
 387     <jar jarfile="${nashorn.api.tests.jar}">
 388       <fileset dir="${build.test.classes.dir}" includes="**/jdk/dynalink/**" excludes="**/jdk/dynalink/test/Trusted**"/>
 389       <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
 390       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
 391       <fileset dir="${build.test.classes.dir}" includes="**/resources/*.js"/>
 392       <fileset dir="${build.test.classes.dir}" includes="**/UnnamedPackage**"/>
 393     </jar>
 394 
 395   </target>
 396 
 397   <target name="generate-security-config" depends="generate-policy-file, generate-security-properties-file"/>
 398 
 399   <target name="generate-security-properties-file" depends="prepare">
 400     <echo file="${build.dir}/nashorn.security.properties">
 401 
 402 package.access=sun.misc.,\
 403     sun.reflect.,\
 404     jdk.nashorn.internal.
 405 
 406     </echo>
 407   </target>
 408 
 409   <target name="generate-policy-file" depends="prepare">
 410     <echo file="${build.dir}/nashorn.policy">
 411 
 412 grant codeBase "file:/${basedir}/${dynalink.module.classes.dir}" {
 413     permission java.security.AllPermission;
 414 };
 415 
 416 grant codeBase "file:/${basedir}/${nashorn.module.classes.dir}" {
 417     permission java.security.AllPermission;
 418 };
 419 
 420 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
 421     permission java.security.AllPermission;
 422 };
 423 
 424 grant codeBase "file:/${basedir}/${nashorn.api.tests.jar}" {
 425     permission java.util.PropertyPermission "parserapitest.*", "read";
 426     permission java.util.PropertyPermission "test.*", "read";
 427     permission java.util.PropertyPermission "test262.*", "read";
 428     permission java.io.FilePermission "${basedir}/test/-","read";


 595             verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 596       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 597       <jvmarg line="${debug.test.jvmargs}"/>
 598       <propertyset>
 599         <propertyref prefix="nashorn."/>
 600       </propertyset>
 601       <propertyset>
 602         <propertyref prefix="test-sys-prop."/>
 603         <mapper from="test-sys-prop.*" to="*" type="glob"/>
 604       </propertyset>
 605       <sysproperty key="optimistic.override" value="${optimistic}"/>
 606       <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
 607       <classpath>
 608           <pathelement path="${run.test.classpath}"/>
 609       </classpath>
 610     </testng>
 611   </target>
 612 
 613   <target name="test" depends="prepare, javadoc, test-pessimistic, test-optimistic"/>
 614 
 615   <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
 616     <echo message="Running test suite in OPTIMISTIC mode..."/>
 617     <antcall target="-test-nosecurity" inheritRefs="true">
 618       <param name="optimistic" value="true"/>
 619       <param name="testResultsSubDir" value="optimistic"/>
 620     </antcall>
 621     <antcall target="-test-security" inheritRefs="true">
 622       <param name="optimistic" value="true"/>
 623       <param name="testResultsSubDir" value="optimistic"/>
 624     </antcall>
 625   </target>
 626 
 627   <target name="test-pessimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
 628     <echo message="Running test suite in PESSIMISTIC mode..."/>
 629     <antcall target="-test-nosecurity" inheritRefs="true">
 630       <param name="optimistic" value="false"/>
 631       <param name="testResultsSubDir" value="pessimistic"/>
 632     </antcall>
 633     <antcall target="-test-security" inheritRefs="true">
 634       <param name="optimistic" value="false"/>
 635       <param name="testResultsSubDir" value="pessimistic"/>
 636     </antcall>
 637   </target>
 638 
 639   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
 640     <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy TestNG and dependency JARs, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar to the test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
 641   </target>
 642 
 643   <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
 644     <fileset id="test.classes" dir="${build.test.classes.dir}">
 645        <include name="**/framework/*Test.class"/>
 646     </fileset>
 647 


 650     <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
 651         <not>
 652             <os family="mac"/>
 653         </not>
 654     </condition>
 655 
 656     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 657        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 658       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
 659       <propertyset>
 660         <propertyref prefix="testjfx-test-sys-prop."/>
 661         <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
 662       </propertyset>
 663       <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
 664       <classpath>
 665           <pathelement path="${testjfx.run.test.classpath}"/>
 666       </classpath>
 667     </testng>
 668   </target>
 669 
 670   <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
 671     <fileset id="test.classes" dir="${build.test.classes.dir}">
 672        <include name="**/framework/*Test.class"/>
 673     </fileset>
 674 
 675     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 676        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 677       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 678       <propertyset>
 679         <propertyref prefix="testmarkdown-test-sys-prop."/>
 680         <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
 681       </propertyset>
 682       <classpath>
 683           <pathelement path="${run.test.classpath}"/>
 684       </classpath>
 685     </testng>
 686   </target>
 687 
 688   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
 689     <fileset id="test.classes" dir="${build.test.classes.dir}">
 690        <include name="**/framework/*Test.class"/>
 691     </fileset>
 692 
 693     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 694        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 695       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 696       <propertyset>
 697         <propertyref prefix="nashorn."/>
 698       </propertyset>
 699       <propertyset>
 700         <propertyref prefix="test262-test-sys-prop."/>
 701         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
 702       </propertyset>
 703       <classpath>
 704           <pathelement path="${run.test.classpath}"/>
 705       </classpath>
 706     </testng>
 707   </target>
 708 
 709   <target name="test262parallel" depends="test262-parallel"/>
 710 
 711   <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
 712     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
 713     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true" failonerror="true">
 714       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
 715       <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
 716       <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
 717       <classpath>
 718           <pathelement path="${run.test.classpath}"/>
 719       </classpath>
 720       <syspropertyset>
 721           <propertyref prefix="test262-test-sys-prop."/>
 722           <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
 723       </syspropertyset>
 724     </java>
 725   </target>
 726 
 727   <target name="testparallel" depends="test-parallel"/>
 728 
 729   <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
 730       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
 731       <java classname="${parallel.test.runner}" dir="${basedir}"
 732         failonerror="true"
 733         fork="true">
 734       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 735       <classpath>
 736           <pathelement path="${run.test.classpath}"/>
 737       <pathelement path="${build.test.classes.dir}"/>
 738       </classpath>
 739       <syspropertyset>
 740           <propertyref prefix="test-sys-prop."/>
 741           <mapper type="glob" from="test-sys-prop.*" to="*"/>
 742       </syspropertyset>
 743       </java>
 744   </target>
 745 
 746   <target name="all" depends="test, docs"
 747       description="Build, test and generate docs for nashorn"/>
 748 
 749   <target name="run" depends="jar"


< prev index next >