make/build.xml

Mon, 17 Mar 2014 18:02:00 +0530

author
sundar
date
Mon, 17 Mar 2014 18:02:00 +0530
changeset 771
5ab19753ce4a
parent 769
5a1ae83c295f
child 775
267e9e895282
permissions
-rw-r--r--

8037400: Remove getInitialMap getters and GlobalObject interface
Reviewed-by: lagergren, jlaskey, attila

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--
     3  Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
     4  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6  This code is free software; you can redistribute it and/or modify it
     7  under the terms of the GNU General Public License version 2 only, as
     8  published by the Free Software Foundation.
    10  This code is distributed in the hope that it will be useful, but WITHOUT
    11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    12  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    13  version 2 for more details (a copy is included in the LICENSE file that
    14  accompanied this code).
    16  You should have received a copy of the GNU General Public License version
    17  2 along with this work; if not, write to the Free Software Foundation,
    18  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21  or visit www.oracle.com if you need additional information or have any
    22  questions.
    23 -->
    24 <project name="nashorn" default="test" basedir="..">
    25   <import file="build-nasgen.xml"/>
    26   <import file="build-benchmark.xml"/>
    27   <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="nashorn.ext.path">
    36       <pathelement location="${dist.dir}"/>
    37     </path>
    38     <property name="ext.class.path" value="-Djava.ext.dirs=&quot;${toString:nashorn.ext.path}&quot;"/>
    39     <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
    40       <available file="/usr/local/bin/svn"/>
    41     </condition>
    42     <condition property="hg.executable" value="/usr/local/bin/hg" else="hg">
    43       <available file="/usr/local/bin/hg"/>
    44     </condition>
    45     <!-- check if JDK already has ASM classes -->
    46     <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
    47     <!-- check if testng.jar is avaiable -->
    48     <available property="testng.available" file="${file.reference.testng.jar}"/>
    49     <!-- check if Jemmy ang testng.jar are avaiable -->
    50     <condition property="jemmy.jfx.testng.available" value="true">
    51       <and> 
    52         <available file="${file.reference.jemmyfx.jar}"/>
    53         <available file="${file.reference.jemmycore.jar}"/>
    54         <available file="${file.reference.jemmyawtinput.jar}"/>
    55         <available file="${file.reference.jfxrt.jar}"/>
    56         <isset property="testng.available"/>
    57       </and>
    58     </condition>
    60     <!-- enable/disable make code coverage -->
    61     <condition property="cc.enabled">
    62         <istrue value="${make.code.coverage}" />
    63     </condition>
    65     <!-- exclude tests in exclude lists -->
    66     <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt">
    67       <istrue value="${make.code.coverage}" />
    68     </condition>
    69   </target>
    71   <target name="init" depends="init-conditions, init-cc">
    73     <!-- extends jvm args -->
    74     <property name="run.test.jvmargs" value="${run.test.jvmargs.main}  ${run.test.cc.jvmargs}"/>
    75     <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main}  ${run.test.cc.jvmargs}" />
    77     <echo message="run.test.jvmargs=${run.test.jvmargs}"/>
    78     <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
    79     <echo message="run.test.xms=${run.test.xms}"/>
    80     <echo message="run.test.xmx=${run.test.xmx}"/>
    82   </target>
    84   <target name="prepare" depends="init">
    85     <mkdir dir="${build.dir}"/>
    86     <mkdir dir="${build.classes.dir}"/>
    87     <mkdir dir="${build.classes.dir}/META-INF/services"/>
    88     <mkdir dir="${build.test.classes.dir}"/>
    89     <mkdir dir="${dist.dir}"/>
    90     <mkdir dir="${dist.javadoc.dir}"/>
    91   </target>
    93   <target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
    94     <delete includeemptydirs="true">
    95       <fileset dir="${build.dir}" erroronmissingdir="false"/>
    96     </delete>
    97     <delete dir="${dist.dir}"/>
    98   </target>
   100   <!-- do it only if ASM is not available -->
   101   <target name="compile-asm" depends="prepare" unless="asm.available">
   102     <javac srcdir="${jdk.asm.src.dir}"
   103            destdir="${build.classes.dir}"
   104            excludes="**/optimizer/* **/xml/* **/attrs/*"
   105            source="${javac.source}"
   106            target="${javac.target}"
   107            debug="${javac.debug}"
   108            encoding="${javac.encoding}"
   109            includeantruntime="false"/>
   110   </target>
   112   <target name="compile" depends="compile-asm" description="Compiles nashorn">
   113     <javac srcdir="${src.dir}"
   114            destdir="${build.classes.dir}"
   115            classpath="${javac.classpath}"
   116            source="${javac.source}"
   117            target="${javac.target}"
   118            debug="${javac.debug}"
   119            encoding="${javac.encoding}"
   120            includeantruntime="false" fork="true">
   121       <compilerarg value="-J-Djava.ext.dirs="/>
   122       <compilerarg value="-Xlint:unchecked"/>
   123       <compilerarg value="-Xlint:deprecation"/>
   124       <compilerarg value="-XDignore.symbol.file"/>
   125       <compilerarg value="-Xdiags:verbose"/>
   126     </javac>
   127     <copy todir="${build.classes.dir}/META-INF/services">
   128        <fileset dir="${meta.inf.dir}/services/"/>
   129     </copy>
   130      <copy todir="${build.classes.dir}/jdk/nashorn/api/scripting/resources">
   131        <fileset dir="${src.dir}/jdk/nashorn/api/scripting/resources/"/>
   132     </copy>
   133     <copy todir="${build.classes.dir}/jdk/nashorn/internal/runtime/resources">
   134        <fileset dir="${src.dir}/jdk/nashorn/internal/runtime/resources/"/>
   135     </copy>
   136     <copy todir="${build.classes.dir}/jdk/nashorn/tools/resources">
   137        <fileset dir="${src.dir}/jdk/nashorn/tools/resources/"/>
   138     </copy>
   139     <copy file="${src.dir}/jdk/internal/dynalink/support/messages.properties" todir="${build.classes.dir}/jdk/internal/dynalink/support"/>
   141     <echo message="full=${nashorn.fullversion}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties"/>
   142     <echo file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true">${line.separator}</echo>
   143     <echo message="release=${nashorn.version}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
   144   </target>
   146   <target name="jar" depends="compile, run-nasgen, generate-cc-template" description="Creates nashorn.jar" unless="compile.suppress.jar">
   147     <jar jarfile="${dist.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
   148       <fileset dir="${build.classes.dir}"/>
   149       <manifest>
   150         <attribute name="Archiver-Version" value="n/a"/>
   151         <attribute name="Build-Jdk" value="${java.runtime.version}"/>
   152         <attribute name="Built-By" value="n/a"/>
   153         <attribute name="Created-By" value="Ant jar task"/>
   154         <section name="jdk/nashorn/">
   155           <attribute name="Implementation-Title" value="${nashorn.product.name}"/>
   156           <attribute name="Implementation-Version" value="${nashorn.version}"/>
   157         </section>
   158       </manifest>
   159     </jar>
   160   </target>
   162   <target name="use-promoted-nashorn" depends="init">
   163     <delete file="${dist.dir}/nashorn.jar"/>
   164     <copy file="${java.home}/lib/ext/nashorn.jar" todir="${dist.dir}"/>
   165     <property name="compile.suppress.jar" value="defined"/>
   166   </target>
   168   <target name="build-fxshell" depends="jar">
   169     <description>Builds the javafx shell.</description>
   170     <mkdir dir="${fxshell.classes.dir}"/>
   171     <javac srcdir="${fxshell.dir}"
   172            destdir="${fxshell.classes.dir}"
   173            classpath="${dist.jar}:${javac.classpath}"
   174            debug="${javac.debug}"
   175            encoding="${javac.encoding}"
   176            includeantruntime="false">
   177     </javac>
   178     <jar jarfile="${fxshell.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
   179       <fileset dir="${fxshell.classes.dir}"/>
   180       <manifest>
   181         <attribute name="Archiver-Version" value="n/a"/>
   182         <attribute name="Build-Jdk" value="${java.runtime.version}"/>
   183         <attribute name="Built-By" value="n/a"/>
   184         <attribute name="Created-By" value="Ant jar task"/>
   185         <section name="jdk/nashorn/">
   186           <attribute name="Implementation-Title" value="Oracle Nashorn FXShell"/>
   187           <attribute name="Implementation-Version" value="${nashorn.version}"/>
   188         </section>
   189       </manifest>
   190     </jar>
   191   </target>
   193   <target name="javadoc" depends="prepare">
   194     <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" windowtitle="${nashorn.product.name} ${nashorn.version}" additionalparam="-quiet" failonerror="true">
   195       <classpath>
   196         <pathelement location="${build.classes.dir}"/>
   197       </classpath>
   198       <fileset dir="${src.dir}" includes="**/*.java"/>
   199       <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
   200       <link href="http://docs.oracle.com/javase/7/docs/api/"/>
   201       <!-- The following tags are used only in ASM sources - just ignore these -->
   202       <tag name="label" description="label tag in ASM sources" enabled="false"/>
   203       <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
   204       <tag name="associates" description="associates tag in ASM sources" enabled="false"/>
   205     </javadoc>
   206   </target>
   208   <!-- generate shell.html for shell tool documentation -->
   209   <target name="shelldoc" depends="jar">
   210     <java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
   211       <jvmarg line="${ext.class.path}"/>
   212       <arg value="-scripting"/>
   213       <arg value="docs/genshelldoc.js"/>
   214     </java>
   215   </target>
   217   <!-- generate all docs -->
   218   <target name="docs" depends="javadoc, shelldoc"/>
   220   <!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
   221   <target name="dist" depends="jar">
   222       <zip destfile="${build.zip}" basedir=".."
   223           excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
   224       <tar destfile="${build.gzip}" basedir=".." compression="gzip"
   225           excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
   226   </target>
   228   <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
   229     <!-- testng task -->
   230     <taskdef name="testng" classname="org.testng.TestNGAntTask"
   231         classpath="${file.reference.testng.jar}"/>
   233     <javac srcdir="${test.src.dir}"
   234            destdir="${build.test.classes.dir}"
   235            classpath="${javac.test.classpath}"
   236            source="${javac.source}"
   237            target="${javac.target}"
   238            debug="${javac.debug}"
   239            encoding="${javac.encoding}"
   240            includeantruntime="false" fork="true">
   241         <compilerarg value="-J-Djava.ext.dirs="/>
   242         <compilerarg value="-Xlint:unchecked"/>
   243         <compilerarg value="-Xlint:deprecation"/>
   244         <compilerarg value="-Xdiags:verbose"/>
   245     </javac>
   247     <copy todir="${build.test.classes.dir}/META-INF/services">
   248        <fileset dir="${test.src.dir}/META-INF/services/"/>
   249     </copy>
   251     <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/resources">
   252        <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/resources"/>
   253     </copy>
   255     <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/resources">
   256        <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/resources"/>
   257     </copy>
   259     <!-- tests that check nashorn internals and internal API -->
   260     <jar jarfile="${nashorn.internal.tests.jar}">
   261       <fileset dir="${build.test.classes.dir}" excludes="**/api/**"/>
   262     </jar>
   264     <!-- tests that check nashorn script engine (jsr-223) API -->
   265     <jar jarfile="${nashorn.api.tests.jar}">
   266       <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
   267       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
   268       <fileset dir="${build.test.classes.dir}" includes="**/resources/*.js"/>
   269     </jar>
   271   </target>
   273   <target name="generate-policy-file" depends="prepare">
   274     <echo file="${build.dir}/nashorn.policy">
   276 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
   277     permission java.security.AllPermission;
   278 };
   280 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
   281     permission java.security.AllPermission;
   282 };
   284 grant codeBase "file:/${basedir}/test/script/trusted/*" {
   285     permission java.security.AllPermission;
   286 };
   288 grant codeBase "file:/${basedir}/test/script/maptests/*" {
   289     permission java.io.FilePermission "${basedir}/test/script/maptests/*","read";
   290     permission java.lang.RuntimePermission "nashorn.debugMode";
   291 };
   293 grant codeBase "file:/${basedir}/test/script/basic/*" {
   294     permission java.io.FilePermission "${basedir}/test/script/-", "read";
   295     permission java.io.FilePermission "$${user.dir}", "read";
   296     permission java.util.PropertyPermission "user.dir", "read";
   297     permission java.util.PropertyPermission "nashorn.test.*", "read";
   298 };
   300 grant codeBase "file:/${basedir}/test/script/basic/parser/*" {
   301     permission java.io.FilePermission "${basedir}/test/script/-", "read";
   302     permission java.io.FilePermission "$${user.dir}", "read";
   303     permission java.util.PropertyPermission "user.dir", "read";
   304     permission java.util.PropertyPermission "nashorn.test.*", "read";
   305 };
   307 grant codeBase "file:/${basedir}/test/script/basic/JDK-8010946-privileged.js" {
   308     permission java.util.PropertyPermission "java.security.policy", "read";
   309 };
   311 grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
   312     permission java.lang.RuntimePermission "nashorn.JavaReflection";
   313 };
   315     </echo>
   317     <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace>    <!--hack for Windows - to make URLs with normal path separators -->
   318     <replace file="${build.dir}/nashorn.policy"><replacetoken>//</replacetoken><replacevalue>/</replacevalue></replace>   <!--hack for Unix - to avoid leading // in URLs -->
   320   </target>
   322   <target name="check-external-tests">
   323       <available file="${test.external.dir}/prototype" property="test-sys-prop.external.prototype"/>
   324       <available file="${test.external.dir}/sunspider" property="test-sys-prop.external.sunspider"/>
   325       <available file="${test.external.dir}/underscore" property="test-sys-prop.external.underscore"/>
   326       <available file="${test.external.dir}/octane" property="test-sys-prop.external.octane"/>
   327       <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/>
   328       <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/>
   329       <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
   330   </target>
   332   <target name="check-testng" unless="testng.available">
   333     <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
   334   </target>
   336   <target name="test" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   337     <fileset id="test.classes" dir="${build.test.classes.dir}">
   338       <include name="**/api/javaaccess/*Test.class"/>
   339       <include name="**/api/scripting/*Test.class"/>
   340       <include name="**/codegen/*Test.class"/>
   341       <include name="**/parser/*Test.class"/>
   342       <include name="**/runtime/*Test.class"/>
   343       <include name="**/runtime/regexp/*Test.class"/>
   344       <include name="**/runtime/regexp/joni/*Test.class"/>
   345       <include name="**/framework/*Test.class"/>
   346     </fileset>
   348     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   349        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   350       <jvmarg line="${ext.class.path}"/>
   351       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
   352       <propertyset>
   353         <propertyref prefix="test-sys-prop."/>
   354         <mapper from="test-sys-prop.*" to="*" type="glob"/>
   355       </propertyset>
   356       <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
   357       <classpath>
   358           <pathelement path="${run.test.classpath}"/>
   359       </classpath>
   360     </testng>
   361   </target>
   363   <target name="test-basicparallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file">
   364       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
   365       <java classname="${parallel.test.runner}" dir="${basedir}" classpath="${build.test.classes.dir}" failonerror="true" fork="true">
   366       <jvmarg line="${ext.class.path}"/>
   367       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
   368       <syspropertyset>
   369           <propertyref prefix="test-sys-prop."/>
   370           <mapper type="glob" from="test-sys-prop.*" to="*"/>
   371       </syspropertyset>
   372       </java>
   373   </target>
   375   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
   376     <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."/>
   377   </target>
   379   <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
   380     <fileset id="test.classes" dir="${build.test.classes.dir}">
   381        <include name="**/framework/*Test.class"/>
   382     </fileset>
   384     <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
   386     <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
   387 		<not>
   388             <os family="mac"/>
   389         </not>
   390 	</condition>
   392     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   393        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   394       <jvmarg line="${ext.class.path}"/>
   395       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   396       <propertyset>
   397         <propertyref prefix="testjfx-test-sys-prop."/>
   398         <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
   399       </propertyset>
   400       <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
   401       <classpath>
   402           <pathelement path="${testjfx.run.test.classpath}"/>
   403       </classpath>
   404     </testng>
   405   </target>
   407   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   408     <fileset id="test.classes" dir="${build.test.classes.dir}">
   409        <include name="**/framework/*Test.class"/>
   410     </fileset>
   412     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
   413        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
   414       <jvmarg line="${ext.class.path}"/>
   415       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
   416       <propertyset>
   417         <propertyref prefix="test262-test-sys-prop."/>
   418         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
   419       </propertyset>
   420       <classpath>
   421           <pathelement path="${run.test.classpath}"/>
   422       </classpath>
   423     </testng>
   424   </target>
   426   <target name="test262parallel" depends="test262-parallel"/>
   428   <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
   429     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
   430     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
   431       <jvmarg line="${ext.class.path}"/>
   432       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
   433       <classpath>
   434           <pathelement path="${run.test.classpath}"/>
   435       </classpath>
   436       <syspropertyset>
   437           <propertyref prefix="test262-test-sys-prop."/>
   438           <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
   439       </syspropertyset>
   440     </java>
   441   </target>
   443   <target name="all" depends="test, docs"
   444       description="Build, test and generate docs for nashorn"/>
   446   <target name="run" depends="jar"
   447       description="Run the shell with a sample script">
   448     <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
   449         <jvmarg line="${ext.class.path}"/>
   450         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   451         <arg value="-dump-on-error"/>
   452         <arg value="test.js"/>
   453     </java>
   454   </target>
   456   <target name="debug" depends="jar"
   457       description="Debug the shell with a sample script">
   458     <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
   459         <jvmarg line="${ext.class.path}"/>
   460         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
   461         <arg value="--print-code"/>
   462         <arg value="--verify-code"/>
   463         <arg value="--print-symbols"/>
   464         <jvmarg value="-Dnashorn.codegen.debug=true"/>
   465         <arg value="test.js"/>
   466     </java>
   467   </target>
   469   <!-- targets to get external script tests -->
   471   <!-- test262 test suite -->
   472   <target name="get-test262" depends="init" unless="${test-sys-prop.external.test262}">
   473     <!-- clone test262 mercurial repo -->
   474     <exec executable="${hg.executable}">
   475        <arg value="clone"/>
   476        <arg value="http://hg.ecmascript.org/tests/test262"/>
   477        <arg value="${test.external.dir}/test262"/>
   478     </exec>
   479   </target>
   480   <target name="update-test262" depends="init" if="${test-sys-prop.external.test262}">
   481     <!-- update test262 mercurial repo -->
   482     <exec executable="${hg.executable}" dir="${test.external.dir}/test262">
   483        <arg value="pull"/>
   484        <arg value="-u"/>
   485     </exec>
   486   </target>
   488   <!-- octane benchmark -->
   489   <target name="get-octane" depends="init" unless="${test-sys-prop.external.octane}">
   490     <!-- checkout octane benchmarks -->
   491     <exec executable="${svn.executable}">
   492        <arg value="--non-interactive"/>
   493        <arg value="--trust-server-cert"/>
   494        <arg value="checkout"/>
   495        <arg value="http://octane-benchmark.googlecode.com/svn/trunk/"/>
   496        <arg value="${test.external.dir}/octane"/>
   497     </exec>
   498   </target>
   499   <target name="update-octane" depends="init" if="${test-sys-prop.external.octane}">
   500     <!-- update octane benchmarks -->
   501     <exec executable="${svn.executable}" dir="${test.external.dir}/octane">
   502        <arg value="--non-interactive"/>
   503        <arg value="--trust-server-cert"/>
   504        <arg value="update"/>
   505     </exec>
   506   </target>
   508   <!-- sunspider benchmark -->
   509   <target name="get-sunspider" depends="init" unless="${test-sys-prop.external.sunspider}">
   510     <!-- checkout sunspider -->
   511     <exec executable="${svn.executable}">
   512        <arg value="--non-interactive"/>
   513        <arg value="--trust-server-cert"/>
   514        <arg value="checkout"/>
   515        <arg value="http://svn.webkit.org/repository/webkit/trunk/PerformanceTests/SunSpider"/>
   516        <arg value="${test.external.dir}/sunspider"/>
   517     </exec>
   518   </target>
   519   <target name="update-sunspider" depends="init" if="${test-sys-prop.external.sunspider}">
   520     <!-- update sunspider -->
   521     <exec executable="${svn.executable}" dir="${test.external.dir}/sunspider">
   522        <arg value="--non-interactive"/>
   523        <arg value="--trust-server-cert"/>
   524        <arg value="update"/>
   525     </exec>
   526   </target>
   528   <!-- get all external test scripts -->
   529   <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider">
   530     <!-- make external test dir -->
   531     <mkdir dir="${test.external.dir}"/>
   533     <!-- jquery -->
   534     <mkdir dir="${test.external.dir}/jquery"/>
   535     <get src="http://code.jquery.com/jquery-1.7.2.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
   536     <get src="http://code.jquery.com/jquery-1.7.2.min.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
   538     <!-- prototype -->
   539     <mkdir dir="${test.external.dir}/prototype"/>
   540     <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"/>
   542     <!-- underscorejs -->
   543     <mkdir dir="${test.external.dir}/underscore"/>
   544     <get src="http://underscorejs.org/underscore.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
   545     <get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
   547     <!-- yui -->
   548     <mkdir dir="${test.external.dir}/yui"/>
   549     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
   550     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
   552   </target>
   554   <!-- update external test suites that are pulled from source control systems -->
   555   <target name="update-externals" depends="init, check-external-tests, update-test262, update-octane, update-sunspider"/>
   557   <!-- run all perf tests -->
   558   <target name="perf" depends="externals, update-externals, sunspider, octane"/>
   560   <!-- run all tests -->
   561   <target name="exit-if-no-testng" depends="init, check-testng" unless="${testng.available}">
   562      <fail message="Exiting.."/>
   563   </target>
   565   <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
   567 </project>

mercurial