make/build.xml

Thu, 04 Sep 2014 18:47:18 +0200

author
hannesw
date
Thu, 04 Sep 2014 18:47:18 +0200
changeset 991
b7a2db4de254
parent 984
dd9ea030e762
child 1036
8a99ee1fb375
permissions
-rw-r--r--

8051889: Implement block scoping in symbol assignment and scope computation
Reviewed-by: attila, lagergren

     1 <?xml version="1.0" encoding="UTF-8"?>
     3 <!--
     4  Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
     5  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7  This code is free software; you can redistribute it and/or modify it
     8  under the terms of the GNU General Public License version 2 only, as
     9  published by the Free Software Foundation.
    11  This code is distributed in the hope that it will be useful, but WITHOUT
    12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  version 2 for more details (a copy is included in the LICENSE file that
    15  accompanied this code).
    17  You should have received a copy of the GNU General Public License version
    18  2 along with this work; if not, write to the Free Software Foundation,
    19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  or visit www.oracle.com if you need additional information or have any
    23  questions.
    24 -->
    26 <project name="nashorn" default="test" basedir="..">
    27   <import file="build-nasgen.xml"/>
    28   <import file="code_coverage.xml"/>
    30   <target name="init-conditions">
    31     <!-- loading locally defined resources and properties. NB they owerwrite default ones defined later -->
    32     <property file="${user.home}/.nashorn.project.local.properties"/>
    34     <loadproperties srcFile="make/project.properties"/>
    35     <path id="dist.path">
    36          <pathelement location="${dist.dir}"/>
    37     </path>
    38     <path id="nashorn.ext.path">
    39       <pathelement location="${dist.dir}"/>
    40       <pathelement location="${java.ext.dirs}"/>
    41     </path>
    42     <property name="ext.class.path" value="-Djava.ext.dirs=&quot;${toString:nashorn.ext.path}&quot;"/>
    43     <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
    44       <available file="/usr/local/bin/svn"/>
    45     </condition>
    46     <condition property="hg.executable" value="/usr/local/bin/hg" else="hg">
    47       <available file="/usr/local/bin/hg"/>
    48     </condition>
    49     <condition property="git.executable" value="/usr/local/bin/git" else="git">
    50       <available file="/usr/local/bin/git"/>
    51     </condition>
    52     <!-- check if JDK already has ASM classes -->
    53     <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
    54     <!-- check if testng.jar is avaiable -->
    55     <available property="testng.available" file="${file.reference.testng.jar}"/>
    56     <!-- check if Jemmy ang testng.jar are avaiable -->
    57     <condition property="jemmy.jfx.testng.available" value="true">
    58       <and>
    59         <available file="${file.reference.jemmyfx.jar}"/>
    60         <available file="${file.reference.jemmycore.jar}"/>
    61         <available file="${file.reference.jemmyawtinput.jar}"/>
    62         <available file="${file.reference.jfxrt.jar}"/>
    63         <isset property="testng.available"/>
    64       </and>
    65     </condition>
    67     <!-- enable/disable make code coverage -->
    68     <condition property="cc.enabled">
    69         <istrue value="${make.code.coverage}" />
    70     </condition>
    72     <!-- exclude tests in exclude lists -->
    73     <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt">
    74       <istrue value="${make.code.coverage}" />
    75     </condition>
    77     <condition property="jfr.options" value="${run.test.jvmargs.jfr}" else="">
    78       <istrue value="${jfr}"/>
    79     </condition>
    80   </target>
    82   <target name="init" depends="init-conditions, init-cc">
    83     <!-- extends jvm args -->
    84     <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
    85     <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
    87     <echo message="run.test.jvmargs=${run.test.jvmargs}"/>
    88     <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
    89     <echo message="run.test.xms=${run.test.xms}"/>
    90     <echo message="run.test.xmx=${run.test.xmx}"/>
    92   </target>
    94   <target name="prepare" depends="init">
    95     <mkdir dir="${build.dir}"/>
    96     <mkdir dir="${build.classes.dir}"/>
    97     <mkdir dir="${build.classes.dir}/META-INF/services"/>
    98     <mkdir dir="${build.test.classes.dir}"/>
    99     <mkdir dir="${dist.dir}"/>
   100     <mkdir dir="${dist.javadoc.dir}"/>
   101   </target>
   103   <target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
   104     <delete includeemptydirs="true">
   105       <fileset dir="${build.dir}" erroronmissingdir="false"/>
   106     </delete>
   107     <delete dir="${dist.dir}"/>
   108   </target>
   110   <!-- do it only if ASM is not available -->
   111   <target name="compile-asm" depends="prepare" unless="asm.available">
   112     <javac srcdir="${jdk.asm.src.dir}"
   113            destdir="${build.classes.dir}"
   114            excludes="**/optimizer/* **/xml/* **/attrs/*"
   115            source="${javac.source}"
   116            target="${javac.target}"
   117            debug="${javac.debug}"
   118            encoding="${javac.encoding}"
   119            includeantruntime="false"/>
   120   </target>
   122   <target name="compile" depends="compile-asm" description="Compiles nashorn">
   123     <javac srcdir="${src.dir}"
   124            destdir="${build.classes.dir}"
   125            classpath="${javac.classpath}"
   126            source="${javac.source}"
   127            target="${javac.target}"
   128            debug="${javac.debug}"
   129            encoding="${javac.encoding}"
   130            includeantruntime="false" fork="true">
   131       <compilerarg value="-J-Djava.ext.dirs="/>
   132       <compilerarg value="-Xlint:all"/>
   133       <compilerarg value="-XDignore.symbol.file"/>
   134       <compilerarg value="-Xdiags:verbose"/>
   135     </javac>
   136     <copy todir="${build.classes.dir}/META-INF/services">
   137        <fileset dir="${meta.inf.dir}/services/"/>
   138     </copy>
   139      <copy todir="${build.classes.dir}/jdk/nashorn/api/scripting/resources">
   140        <fileset dir="${src.dir}/jdk/nashorn/api/scripting/resources/"/>
   141     </copy>
   142     <copy todir="${build.classes.dir}/jdk/nashorn/internal/runtime/resources">
   143        <fileset dir="${src.dir}/jdk/nashorn/internal/runtime/resources/"/>
   144     </copy>
   145     <copy todir="${build.classes.dir}/jdk/nashorn/tools/resources">
   146        <fileset dir="${src.dir}/jdk/nashorn/tools/resources/"/>
   147     </copy>
   148     <copy file="${src.dir}/jdk/internal/dynalink/support/messages.properties" todir="${build.classes.dir}/jdk/internal/dynalink/support"/>
   150     <echo message="full=${nashorn.fullversion}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties"/>
   151     <echo file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true">${line.separator}</echo>
   152     <echo message="release=${nashorn.version}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
   153   </target>
   155   <target name="jar" depends="compile, run-nasgen, generate-cc-template" description="Creates nashorn.jar" unless="compile.suppress.jar">
   156     <jar jarfile="${dist.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
   157       <fileset dir="${build.classes.dir}"/>
   158       <manifest>
   159         <attribute name="Archiver-Version" value="n/a"/>
   160         <attribute name="Build-Jdk" value="${java.runtime.version}"/>
   161         <attribute name="Built-By" value="n/a"/>
   162         <attribute name="Created-By" value="Ant jar task"/>
   163         <section name="jdk/nashorn/">
   164           <attribute name="Implementation-Title" value="${nashorn.product.name}"/>
   165           <attribute name="Implementation-Version" value="${nashorn.version}"/>
   166         </section>
   167       </manifest>
   168     </jar>
   169   </target>
   171   <target name="use-promoted-nashorn" depends="init">
   172     <delete file="${dist.dir}/nashorn.jar"/>
   173     <copy file="${java.home}/lib/ext/nashorn.jar" todir="${dist.dir}"/>
   174     <property name="compile.suppress.jar" value="defined"/>
   175   </target>
   177   <target name="build-fxshell" depends="jar">
   178     <description>Builds the javafx shell.</description>
   179     <mkdir dir="${fxshell.classes.dir}"/>
   180     <javac srcdir="${fxshell.dir}"
   181            destdir="${fxshell.classes.dir}"
   182            classpath="${dist.jar}:${javac.classpath}"
   183            debug="${javac.debug}"
   184            encoding="${javac.encoding}"
   185            includeantruntime="false">
   186     </javac>
   187     <jar jarfile="${fxshell.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
   188       <fileset dir="${fxshell.classes.dir}"/>
   189       <manifest>
   190         <attribute name="Archiver-Version" value="n/a"/>
   191         <attribute name="Build-Jdk" value="${java.runtime.version}"/>
   192         <attribute name="Built-By" value="n/a"/>
   193         <attribute name="Created-By" value="Ant jar task"/>
   194         <section name="jdk/nashorn/">
   195           <attribute name="Implementation-Title" value="Oracle Nashorn FXShell"/>
   196           <attribute name="Implementation-Version" value="${nashorn.version}"/>
   197         </section>
   198       </manifest>
   199     </jar>
   200   </target>
   202   <target name="javadoc" depends="jar">
   203     <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" 
   204         extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
   205         additionalparam="-quiet" failonerror="true">
   206       <classpath>
   207         <pathelement location="${build.classes.dir}"/>
   208       </classpath>
   209       <fileset dir="${src.dir}" includes="**/*.java"/>
   210       <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
   211       <link href="http://docs.oracle.com/javase/8/docs/api/"/>
   212       <!-- The following tags are used only in ASM sources - just ignore these -->
   213       <tag name="label" description="label tag in ASM sources" enabled="false"/>
   214       <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
   215       <tag name="associates" description="associates tag in ASM sources" enabled="false"/>
   216     </javadoc>
   217   </target>
   219   <!-- generate javadoc only for nashorn extension api classes -->
   220   <target name="javadocapi" depends="jar">
   221     <javadoc destdir="${dist.javadoc.dir}" use="yes" extdirs="${nashorn.ext.path}" 
   222         windowtitle="${nashorn.product.name}" additionalparam="-quiet" failonerror="true">
   223       <classpath>
   224         <pathelement location="${build.classes.dir}"/>
   225       </classpath>
   226       <fileset dir="${src.dir}" includes="jdk/nashorn/api/**/*.java"/>
   227       <link href="http://docs.oracle.com/javase/8/docs/api/"/>
   228     </javadoc>
   229   </target>
   232   <!-- generate shell.html for shell tool documentation -->
   233   <target name="shelldoc" depends="jar">
   234     <java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
   235       <jvmarg line="${ext.class.path}"/>
   236       <arg value="-scripting"/>
   237       <arg value="docs/genshelldoc.js"/>
   238     </java>
   239   </target>
   241   <!-- generate all docs -->
   242   <target name="docs" depends="javadoc, shelldoc"/>
   244   <!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
   245   <target name="dist" depends="jar">
   246       <zip destfile="${build.zip}" basedir=".."
   247           excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
   248       <tar destfile="${build.gzip}" basedir=".." compression="gzip"
   249           excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
   250   </target>
   252   <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
   253     <!-- testng task -->
   254     <taskdef name="testng" classname="org.testng.TestNGAntTask"
   255         classpath="${file.reference.testng.jar}"/>
   257     <javac srcdir="${test.src.dir}"
   258            destdir="${build.test.classes.dir}"
   259            classpath="${javac.test.classpath}"
   260            source="${javac.source}"
   261            target="${javac.target}"
   262            debug="${javac.debug}"
   263            encoding="${javac.encoding}"
   264            includeantruntime="false" fork="true">
   265         <compilerarg value="-J-Djava.ext.dirs="/>
   266         <compilerarg value="-Xlint:unchecked"/>
   267         <compilerarg value="-Xlint:deprecation"/>
   268         <compilerarg value="-Xdiags:verbose"/>
   269     </javac>
   271     <copy todir="${build.test.classes.dir}/META-INF/services">
   272        <fileset dir="${test.src.dir}/META-INF/services/"/>
   273     </copy>
   275     <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/resources">
   276        <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/resources"/>
   277     </copy>
   279     <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/resources">
   280        <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/resources"/>
   281     </copy>
   283     <!-- tests that check nashorn internals and internal API -->
   284     <jar jarfile="${nashorn.internal.tests.jar}">
   285       <fileset dir="${build.test.classes.dir}" excludes="**/api/**"/>
   286     </jar>
   288     <!-- tests that check nashorn script engine (jsr-223) API -->
   289     <jar jarfile="${nashorn.api.tests.jar}">
   290       <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
   291       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
   292       <fileset dir="${build.test.classes.dir}" includes="**/resources/*.js"/>
   293     </jar>
   295   </target>
   297   <target name="generate-policy-file" depends="prepare">
   298     <echo file="${build.dir}/nashorn.policy">
   300 grant codeBase "file:/${toString:dist.path}/nashorn.jar" {
   301     permission java.security.AllPermission;
   302 };
   304 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
   305     permission java.security.AllPermission;
   306 };
   308 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
   309     permission java.security.AllPermission;
   310 };
   311 //// in case of absolute path:
   312 grant codeBase "file:/${nashorn.internal.tests.jar}" {
   313     permission java.security.AllPermission;
   314 };
   316 grant codeBase "file:/${file.reference.testng.jar}" {
   317     permission java.security.AllPermission;
   318 };
   320 grant codeBase "file:/${basedir}/test/script/trusted/*" {
   321     permission java.security.AllPermission;
   322 };
   324 grant codeBase "file:/${basedir}/test/script/maptests/*" {
   325     permission java.io.FilePermission "${basedir}/test/script/maptests/*","read";
   326     permission java.lang.RuntimePermission "nashorn.debugMode";
   327 };
   329 grant codeBase "file:/${basedir}/test/script/basic/*" {
   330     permission java.io.FilePermission "${basedir}/test/script/-", "read";
   331     permission java.io.FilePermission "$${user.dir}", "read";
   332     permission java.util.PropertyPermission "user.dir", "read";
   333     permission java.util.PropertyPermission "nashorn.test.*", "read";
   334 };
   336 grant codeBase "file:/${basedir}/test/script/basic/parser/*" {
   337     permission java.io.FilePermission "${basedir}/test/script/-", "read";
   338     permission java.io.FilePermission "$${user.dir}", "read";
   339     permission java.util.PropertyPermission "user.dir", "read";
   340     permission java.util.PropertyPermission "nashorn.test.*", "read";
   341 };
   343 grant codeBase "file:/${basedir}/test/script/basic/es6/*" {
   344     permission java.io.FilePermission "${basedir}/test/script/-", "read";
   345     permission java.io.FilePermission "$${user.dir}", "read";
   346     permission java.util.PropertyPermission "user.dir", "read";
   347     permission java.util.PropertyPermission "nashorn.test.*", "read";
   348 };
   350 grant codeBase "file:/${basedir}/test/script/basic/JDK-8010946-privileged.js" {
   351     permission java.util.PropertyPermission "java.security.policy", "read";
   352 };
   354 grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
   355     permission java.lang.RuntimePermission "nashorn.JavaReflection";
   356 };
   358 grant codeBase "file:/${basedir}/test/script/markdown.js" {
   359     permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read";
   360 };
   362     </echo>
   364     <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace>    <!--hack for Windows - to make URLs with normal path separators -->
   365     <replace file="${build.dir}/nashorn.policy"><replacetoken>//</replacetoken><replacevalue>/</replacevalue></replace>   <!--hack for Unix - to avoid leading // in URLs -->
   367   </target>
   369   <target name="check-external-tests">
   370       <available file="${test.external.dir}/prototype" property="test-sys-prop.external.prototype"/>
   371       <available file="${test.external.dir}/sunspider" property="test-sys-prop.external.sunspider"/>
   372       <available file="${test.external.dir}/underscore" property="test-sys-prop.external.underscore"/>
   373       <available file="${test.external.dir}/octane" property="test-sys-prop.external.octane"/>
   374       <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/>
   375       <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/>
   376       <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
   377       <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/>
   378   </target>
   380   <target name="check-testng" unless="testng.available">
   381     <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
   382   </target>
   384   <!-- only to be invoked as dependency of "test" target -->
   385   <target name="-test-classes-all" depends="jar" unless="test.class">
   386       <fileset id="test.classes" dir="${build.test.classes.dir}">
   387           <include name="**/api/javaaccess/*Test.class"/>
   388           <include name="**/api/scripting/*Test.class"/>
   389           <include name="**/codegen/*Test.class"/>
   390           <include name="**/parser/*Test.class"/>
   391           <include name="**/runtime/*Test.class"/>
   392           <include name="**/runtime/regexp/*Test.class"/>
   393           <include name="**/runtime/regexp/joni/*Test.class"/>
   394           <include name="**/framework/*Test.class"/>
   395      </fileset>
   396   </target>
   398   <!-- only to be invoked as dependency of "test" target -->
   399   <target name="-test-classes-single" depends="jar" if="test.class">
   400      <fileset id="test.classes" dir="${build.test.classes.dir}">
   401          <include name="${test.class}*"/>
   402      </fileset>
   403   </target>
   405   <!-- only to be invoked as dependency of "test" target -->
   406   <target name="-test-nosecurity" unless="test.class">
   407     <fileset id="test.nosecurity.classes" dir="${build.test.classes.dir}">
   408       <include name="**/framework/ScriptTest.class"/>
   409     </fileset>
   410     <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes"
   411        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   412       <jvmarg line="${ext.class.path}"/>
   413       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
   414       <sysproperty key="nashorn.jar" value="${dist.dir}/nashorn.jar"/>
   415       <propertyset>
   416         <propertyref prefix="nashorn."/>
   417       </propertyset>
   418       <propertyset>
   419         <propertyref prefix="test-sys-prop-no-security."/>
   420         <mapper from="test-sys-prop-no-security.*" to="*" type="glob"/>
   421       </propertyset>
   422       <classpath>
   423           <pathelement path="${run.test.classpath}"/>
   424       </classpath>
   425     </testng>
   426   </target>
   428   <!-- only to be invoked as dependency of "test" target -->
   429   <target name="-test-security">
   430     <delete dir="${build.dir}/nashorn_code_cache"/>
   431     <property name="debug.test.jvmargs" value=""/>
   432     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   433        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   434       <jvmarg line="${ext.class.path}"/>
   435       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
   436       <jvmarg line="${debug.test.jvmargs}"/>
   437       <propertyset>
   438         <propertyref prefix="nashorn."/>
   439       </propertyset>
   440       <propertyset>
   441         <propertyref prefix="test-sys-prop."/>
   442         <mapper from="test-sys-prop.*" to="*" type="glob"/>
   443       </propertyset>
   444       <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
   445       <classpath>
   446           <pathelement path="${run.test.classpath}"/>
   447       </classpath>
   448     </testng>
   449   </target>
   451   <target name="test" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file, -test-security, -test-nosecurity" if="testng.available"/>
   453   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
   454     <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."/>
   455   </target>
   457   <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
   458     <fileset id="test.classes" dir="${build.test.classes.dir}">
   459        <include name="**/framework/*Test.class"/>
   460     </fileset>
   462     <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
   464     <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
   465         <not>
   466             <os family="mac"/>
   467         </not>
   468     </condition>
   470     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   471        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   472       <jvmarg line="${ext.class.path}"/>
   473       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
   474       <propertyset>
   475         <propertyref prefix="testjfx-test-sys-prop."/>
   476         <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
   477       </propertyset>
   478       <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
   479       <classpath>
   480           <pathelement path="${testjfx.run.test.classpath}"/>
   481       </classpath>
   482     </testng>
   483   </target>
   485   <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   486     <fileset id="test.classes" dir="${build.test.classes.dir}">
   487        <include name="**/framework/*Test.class"/>
   488     </fileset>
   490     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   491        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   492       <jvmarg line="${ext.class.path}"/>
   493       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
   494       <propertyset>
   495         <propertyref prefix="testmarkdown-test-sys-prop."/>
   496         <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
   497       </propertyset>
   498       <classpath>
   499           <pathelement path="${run.test.classpath}"/>
   500       </classpath>
   501     </testng>
   502   </target>
   504   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   505     <fileset id="test.classes" dir="${build.test.classes.dir}">
   506        <include name="**/framework/*Test.class"/>
   507     </fileset>
   509     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   510        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   511       <jvmarg line="${ext.class.path}"/>
   512       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
   513       <propertyset>
   514         <propertyref prefix="nashorn."/>
   515       </propertyset>
   516       <propertyset>
   517         <propertyref prefix="test262-test-sys-prop."/>
   518         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
   519       </propertyset>
   520       <classpath>
   521           <pathelement path="${run.test.classpath}"/>
   522       </classpath>
   523     </testng>
   524   </target>
   526   <target name="test262parallel" depends="test262-parallel"/>
   528   <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   529     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
   530     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
   531       <jvmarg line="${ext.class.path}"/>
   532       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
   533       <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
   534       <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
   535       <classpath>
   536           <pathelement path="${run.test.classpath}"/>
   537       </classpath>
   538       <syspropertyset>
   539           <propertyref prefix="test262-test-sys-prop."/>
   540           <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
   541       </syspropertyset>
   542     </java>
   543   </target>
   545   <target name="testparallel" depends="test-parallel"/>
   547   <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   548       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
   549       <java classname="${parallel.test.runner}" dir="${basedir}"
   550         failonerror="true"
   551         fork="true">
   552       <jvmarg line="${ext.class.path}"/>
   553       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
   554       <classpath>
   555           <pathelement path="${run.test.classpath}"/>
   556       <pathelement path="${build.test.classes.dir}"/>
   557       </classpath>
   558       <syspropertyset>
   559           <propertyref prefix="test-sys-prop."/>
   560           <mapper type="glob" from="test-sys-prop.*" to="*"/>
   561       </syspropertyset>
   562       </java>
   563   </target>
   565   <target name="all" depends="test, docs"
   566       description="Build, test and generate docs for nashorn"/>
   568   <target name="run" depends="jar"
   569       description="Run the shell with a sample script">
   570     <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
   571         <jvmarg line="${ext.class.path}"/>
   572         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   573         <arg value="-dump-on-error"/>
   574         <arg value="test.js"/>
   575     </java>
   576   </target>
   578   <target name="debug" depends="jar"
   579       description="Debug the shell with a sample script">
   580     <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
   581         <jvmarg line="${ext.class.path}"/>
   582         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   583         <arg value="--print-code"/>
   584         <arg value="--verify-code"/>
   585         <arg value="--print-symbols"/>
   586         <jvmarg value="-Dnashorn.codegen.debug=true"/>
   587         <arg value="test.js"/>
   588     </java>
   589   </target>
   591   <!-- targets to get external script tests -->
   593   <!-- test262 test suite -->
   594   <target name="get-test262" depends="init" unless="${test-sys-prop.external.test262}">
   595     <!-- clone test262 git repo -->
   596     <exec executable="${git.executable}">
   597        <arg value="clone"/>
   598        <arg value="--branch"/>
   599        <arg value="es5-tests"/>
   600        <arg value="https://github.com/tc39/test262"/>
   601        <arg value="${test.external.dir}/test262"/>
   602     </exec>
   603   </target>
   604   <target name="update-test262" depends="init" if="${test-sys-prop.external.test262}">
   605     <!-- update test262 git repo -->
   606     <exec executable="${git.executable}" dir="${test.external.dir}/test262">
   607        <arg value="pull"/>
   608     </exec>
   609   </target>
   611   <!-- octane benchmark -->
   612   <target name="get-octane" depends="init" unless="${test-sys-prop.external.octane}">
   613     <!-- checkout octane benchmarks -->
   614     <exec executable="${svn.executable}">
   615        <arg value="--non-interactive"/>
   616        <arg value="--trust-server-cert"/>
   617        <arg value="checkout"/>
   618        <arg value="http://octane-benchmark.googlecode.com/svn/trunk/"/>
   619        <arg value="${test.external.dir}/octane"/>
   620     </exec>
   621   </target>
   622   <target name="update-octane" depends="init" if="${test-sys-prop.external.octane}">
   623     <!-- update octane benchmarks -->
   624     <exec executable="${svn.executable}" dir="${test.external.dir}/octane">
   625        <arg value="--non-interactive"/>
   626        <arg value="--trust-server-cert"/>
   627        <arg value="update"/>
   628     </exec>
   629   </target>
   631   <!-- sunspider benchmark -->
   632   <target name="get-sunspider" depends="init" unless="${test-sys-prop.external.sunspider}">
   633     <!-- checkout sunspider -->
   634     <exec executable="${svn.executable}">
   635        <arg value="--non-interactive"/>
   636        <arg value="--trust-server-cert"/>
   637        <arg value="checkout"/>
   638        <arg value="http://svn.webkit.org/repository/webkit/trunk/PerformanceTests/SunSpider"/>
   639        <arg value="${test.external.dir}/sunspider"/>
   640     </exec>
   641   </target>
   642   <target name="update-sunspider" depends="init" if="${test-sys-prop.external.sunspider}">
   643     <!-- update sunspider -->
   644     <exec executable="${svn.executable}" dir="${test.external.dir}/sunspider">
   645        <arg value="--non-interactive"/>
   646        <arg value="--trust-server-cert"/>
   647        <arg value="update"/>
   648     </exec>
   649   </target>
   651   <!-- get all external test scripts -->
   652   <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider">
   653     <!-- make external test dir -->
   654     <mkdir dir="${test.external.dir}"/>
   656     <!-- jquery -->
   657     <mkdir dir="${test.external.dir}/jquery"/>
   658     <get src="http://code.jquery.com/jquery-1.7.2.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
   659     <get src="http://code.jquery.com/jquery-1.7.2.min.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
   661     <!-- prototype -->
   662     <mkdir dir="${test.external.dir}/prototype"/>
   663     <get src="http://ajax.googleapis.com/ajax/libs/prototype/1.7.0/prototype.js" dest="${test.external.dir}/prototype" usetimestamp="true" skipexisting="true" ignoreerrors="true"/>
   665     <!-- underscorejs -->
   666     <mkdir dir="${test.external.dir}/underscore"/>
   667     <get src="http://underscorejs.org/underscore.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
   668     <get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
   670     <!-- yui -->
   671     <mkdir dir="${test.external.dir}/yui"/>
   672     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
   673     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
   675     <!-- showdown -->
   676     <mkdir dir="${test.external.dir}/showdown"/>
   677     <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
   678     <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
   680   </target>
   682   <!-- update external test suites that are pulled from source control systems -->
   683   <target name="update-externals" depends="init, check-external-tests, update-test262, update-octane, update-sunspider"/>
   685   <!-- run all perf tests -->
   686   <target name="perf" depends="externals, update-externals, sunspider, octane"/>
   688   <!-- run all tests -->
   689   <target name="exit-if-no-testng" depends="init, check-testng" unless="${testng.available}">
   690      <fail message="Exiting.."/>
   691   </target>
   693   <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
   695   <import file="build-benchmark.xml"/>
   697 </project>

mercurial