452 <testng outputdir="${build.test.results.dir}/${testResultsSubDir}" classfilesetref="test.classes"
453 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
454 <jvmarg line="${boot.class.path}"/>
455 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
456 <jvmarg line="${debug.test.jvmargs}"/>
457 <propertyset>
458 <propertyref prefix="nashorn."/>
459 </propertyset>
460 <propertyset>
461 <propertyref prefix="test-sys-prop."/>
462 <mapper from="test-sys-prop.*" to="*" type="glob"/>
463 </propertyset>
464 <sysproperty key="optimistic.override" value="${optimistic}"/>
465 <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
466 <classpath>
467 <pathelement path="${run.test.classpath}"/>
468 </classpath>
469 </testng>
470 </target>
471
472 <target name="test" depends="javadoc, test-pessimistic, test-optimistic, testmarkdown"/>
473
474 <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">
475 <echo message="Running test suite in OPTIMISTIC mode..."/>
476 <antcall target="-test-nosecurity" inheritRefs="true">
477 <param name="optimistic" value="true"/>
478 <param name="testResultsSubDir" value="optimistic"/>
479 </antcall>
480 <antcall target="-test-security" inheritRefs="true">
481 <param name="optimistic" value="true"/>
482 <param name="testResultsSubDir" value="optimistic"/>
483 </antcall>
484 </target>
485
486 <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">
487 <echo message="Running test suite in PESSIMISTIC mode..."/>
488 <antcall target="-test-nosecurity" inheritRefs="true">
489 <param name="optimistic" value="false"/>
490 <param name="testResultsSubDir" value="pessimistic"/>
491 </antcall>
492 <antcall target="-test-security" inheritRefs="true">
493 <param name="optimistic" value="false"/>
494 <param name="testResultsSubDir" value="pessimistic"/>
495 </antcall>
496 </target>
497
498 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
499 <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
500 </target>
501
502 <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
503 <fileset id="test.classes" dir="${build.test.classes.dir}">
504 <include name="**/framework/*Test.class"/>
505 </fileset>
506
507 <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
508
509 <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
510 <not>
511 <os family="mac"/>
512 </not>
513 </condition>
514
515 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
516 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
517 <jvmarg line="${boot.class.path}"/>
518 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
519 <propertyset>
520 <propertyref prefix="testjfx-test-sys-prop."/>
521 <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
522 </propertyset>
523 <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
524 <classpath>
525 <pathelement path="${testjfx.run.test.classpath}"/>
526 </classpath>
527 </testng>
528 </target>
529
530 <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
531 <fileset id="test.classes" dir="${build.test.classes.dir}">
532 <include name="**/framework/*Test.class"/>
533 </fileset>
534
535 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
536 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
537 <jvmarg line="${boot.class.path}"/>
538 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
539 <propertyset>
540 <propertyref prefix="testmarkdown-test-sys-prop."/>
541 <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
542 </propertyset>
543 <classpath>
544 <pathelement path="${run.test.classpath}"/>
545 </classpath>
546 </testng>
547 </target>
548
549 <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
550 <fileset id="test.classes" dir="${build.test.classes.dir}">
551 <include name="**/framework/*Test.class"/>
552 </fileset>
553
554 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
555 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
556 <jvmarg line="${boot.class.path}"/>
557 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
558 <propertyset>
559 <propertyref prefix="nashorn."/>
560 </propertyset>
561 <propertyset>
562 <propertyref prefix="test262-test-sys-prop."/>
563 <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
564 </propertyset>
565 <classpath>
566 <pathelement path="${run.test.classpath}"/>
567 </classpath>
568 </testng>
569 </target>
570
571 <target name="test262parallel" depends="test262-parallel"/>
572
573 <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
574 <!-- use just build.test.classes.dir to avoid referring to TestNG -->
575 <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
576 <jvmarg line="${boot.class.path}"/>
577 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
578 <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
579 <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
580 <classpath>
581 <pathelement path="${run.test.classpath}"/>
582 </classpath>
583 <syspropertyset>
584 <propertyref prefix="test262-test-sys-prop."/>
585 <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
586 </syspropertyset>
587 </java>
588 </target>
589
590 <target name="testparallel" depends="test-parallel"/>
591
592 <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
593 <!-- use just build.test.classes.dir to avoid referring to TestNG -->
594 <java classname="${parallel.test.runner}" dir="${basedir}"
595 failonerror="true"
596 fork="true">
597 <jvmarg line="${boot.class.path}"/>
598 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
599 <classpath>
600 <pathelement path="${run.test.classpath}"/>
601 <pathelement path="${build.test.classes.dir}"/>
602 </classpath>
603 <syspropertyset>
604 <propertyref prefix="test-sys-prop."/>
605 <mapper type="glob" from="test-sys-prop.*" to="*"/>
606 </syspropertyset>
607 </java>
608 </target>
609
610 <target name="all" depends="test, docs"
611 description="Build, test and generate docs for nashorn"/>
612
713 <get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
714
715 <!-- yui -->
716 <mkdir dir="${test.external.dir}/yui"/>
717 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
718 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
719
720 <!-- showdown -->
721 <mkdir dir="${test.external.dir}/showdown"/>
722 <get src="https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
723 <get src="https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
724
725 </target>
726
727 <!-- update external test suites that are pulled from source control systems -->
728 <target name="update-externals" depends="init, check-external-tests, update-test262, update-octane, update-sunspider"/>
729
730 <!-- run all perf tests -->
731 <target name="perf" depends="externals, update-externals, sunspider, octane"/>
732
733 <!-- run all tests -->
734 <target name="exit-if-no-testng" depends="init, check-testng" unless="${testng.available}">
735 <fail message="Exiting.."/>
736 </target>
737
738 <!-- download and install testng.jar -->
739 <target name="get-testng" unless="testng.available">
740 <get src="http://testng.org/testng-6.8.zip" dest="${test.lib}" skipexisting="true" ignoreerrors="true"/>
741 <unzip src="${test.lib}${file.separator}testng-6.8.zip" dest="${test.lib}">
742 <patternset>
743 <include name="testng-6.8/testng-6.8.jar"/>
744 </patternset>
745 </unzip>
746 <move file="${test.lib}${file.separator}testng-6.8${file.separator}testng-6.8.jar" tofile="${test.lib}${file.separator}testng.jar"/>
747 <delete dir="${test.lib}${file.separator}testng-6.8"/>
748 </target>
749
750 <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
751
752 <import file="build-benchmark.xml"/>
753
754 </project>
|
452 <testng outputdir="${build.test.results.dir}/${testResultsSubDir}" classfilesetref="test.classes"
453 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
454 <jvmarg line="${boot.class.path}"/>
455 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
456 <jvmarg line="${debug.test.jvmargs}"/>
457 <propertyset>
458 <propertyref prefix="nashorn."/>
459 </propertyset>
460 <propertyset>
461 <propertyref prefix="test-sys-prop."/>
462 <mapper from="test-sys-prop.*" to="*" type="glob"/>
463 </propertyset>
464 <sysproperty key="optimistic.override" value="${optimistic}"/>
465 <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
466 <classpath>
467 <pathelement path="${run.test.classpath}"/>
468 </classpath>
469 </testng>
470 </target>
471
472 <target name="test" depends="get-testng, javadoc, test-pessimistic, test-optimistic"/>
473
474 <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">
475 <echo message="Running test suite in OPTIMISTIC mode..."/>
476 <antcall target="-test-nosecurity" inheritRefs="true">
477 <param name="optimistic" value="true"/>
478 <param name="testResultsSubDir" value="optimistic"/>
479 </antcall>
480 <antcall target="-test-security" inheritRefs="true">
481 <param name="optimistic" value="true"/>
482 <param name="testResultsSubDir" value="optimistic"/>
483 </antcall>
484 </target>
485
486 <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">
487 <echo message="Running test suite in PESSIMISTIC mode..."/>
488 <antcall target="-test-nosecurity" inheritRefs="true">
489 <param name="optimistic" value="false"/>
490 <param name="testResultsSubDir" value="pessimistic"/>
491 </antcall>
492 <antcall target="-test-security" inheritRefs="true">
493 <param name="optimistic" value="false"/>
494 <param name="testResultsSubDir" value="pessimistic"/>
495 </antcall>
496 </target>
497
498 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
499 <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
500 </target>
501
502 <target name="testjfx" depends="jar, get-testng, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
503 <fileset id="test.classes" dir="${build.test.classes.dir}">
504 <include name="**/framework/*Test.class"/>
505 </fileset>
506
507 <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
508
509 <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
510 <not>
511 <os family="mac"/>
512 </not>
513 </condition>
514
515 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
516 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
517 <jvmarg line="${boot.class.path}"/>
518 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
519 <propertyset>
520 <propertyref prefix="testjfx-test-sys-prop."/>
521 <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
522 </propertyset>
523 <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
524 <classpath>
525 <pathelement path="${testjfx.run.test.classpath}"/>
526 </classpath>
527 </testng>
528 </target>
529
530 <target name="testmarkdown" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
531 <fileset id="test.classes" dir="${build.test.classes.dir}">
532 <include name="**/framework/*Test.class"/>
533 </fileset>
534
535 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
536 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
537 <jvmarg line="${boot.class.path}"/>
538 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
539 <propertyset>
540 <propertyref prefix="testmarkdown-test-sys-prop."/>
541 <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
542 </propertyset>
543 <classpath>
544 <pathelement path="${run.test.classpath}"/>
545 </classpath>
546 </testng>
547 </target>
548
549 <target name="test262" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
550 <fileset id="test.classes" dir="${build.test.classes.dir}">
551 <include name="**/framework/*Test.class"/>
552 </fileset>
553
554 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
555 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
556 <jvmarg line="${boot.class.path}"/>
557 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
558 <propertyset>
559 <propertyref prefix="nashorn."/>
560 </propertyset>
561 <propertyset>
562 <propertyref prefix="test262-test-sys-prop."/>
563 <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
564 </propertyset>
565 <classpath>
566 <pathelement path="${run.test.classpath}"/>
567 </classpath>
568 </testng>
569 </target>
570
571 <target name="test262parallel" depends="test262-parallel"/>
572
573 <target name="test262-parallel" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
574 <!-- use just build.test.classes.dir to avoid referring to TestNG -->
575 <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
576 <jvmarg line="${boot.class.path}"/>
577 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
578 <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
579 <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
580 <classpath>
581 <pathelement path="${run.test.classpath}"/>
582 </classpath>
583 <syspropertyset>
584 <propertyref prefix="test262-test-sys-prop."/>
585 <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
586 </syspropertyset>
587 </java>
588 </target>
589
590 <target name="testparallel" depends="test-parallel"/>
591
592 <target name="test-parallel" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
593 <!-- use just build.test.classes.dir to avoid referring to TestNG -->
594 <java classname="${parallel.test.runner}" dir="${basedir}"
595 failonerror="true"
596 fork="true">
597 <jvmarg line="${boot.class.path}"/>
598 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
599 <classpath>
600 <pathelement path="${run.test.classpath}"/>
601 <pathelement path="${build.test.classes.dir}"/>
602 </classpath>
603 <syspropertyset>
604 <propertyref prefix="test-sys-prop."/>
605 <mapper type="glob" from="test-sys-prop.*" to="*"/>
606 </syspropertyset>
607 </java>
608 </target>
609
610 <target name="all" depends="test, docs"
611 description="Build, test and generate docs for nashorn"/>
612
713 <get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
714
715 <!-- yui -->
716 <mkdir dir="${test.external.dir}/yui"/>
717 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
718 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
719
720 <!-- showdown -->
721 <mkdir dir="${test.external.dir}/showdown"/>
722 <get src="https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
723 <get src="https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
724
725 </target>
726
727 <!-- update external test suites that are pulled from source control systems -->
728 <target name="update-externals" depends="init, check-external-tests, update-test262, update-octane, update-sunspider"/>
729
730 <!-- run all perf tests -->
731 <target name="perf" depends="externals, update-externals, sunspider, octane"/>
732
733 <!-- download and install testng.jar -->
734 <target name="get-testng" depends="prepare" unless="testng.available">
735 <get src="http://testng.org/testng-6.8.zip" dest="${test.lib}" skipexisting="true" ignoreerrors="true"/>
736 <unzip src="${test.lib}${file.separator}testng-6.8.zip" dest="${test.lib}">
737 <patternset>
738 <include name="testng-6.8/testng-6.8.jar"/>
739 </patternset>
740 </unzip>
741 <move file="${test.lib}${file.separator}testng-6.8${file.separator}testng-6.8.jar" tofile="${test.lib}${file.separator}testng.jar"/>
742 <delete dir="${test.lib}${file.separator}testng-6.8"/>
743 </target>
744
745 <!-- run all tests -->
746 <target name="alltests" depends="get-testng, externals, update-externals, test, test262parallel, testmarkdown, perf"/>
747
748 <import file="build-benchmark.xml"/>
749
750 </project>
|