1.1 --- a/make/build.xml Wed Aug 20 10:25:28 2014 +0200 1.2 +++ b/make/build.xml Wed Aug 20 10:26:01 2014 +0200 1.3 @@ -1,4 +1,5 @@ 1.4 <?xml version="1.0" encoding="UTF-8"?> 1.5 + 1.6 <!-- 1.7 Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 1.8 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 @@ -21,12 +22,11 @@ 1.10 or visit www.oracle.com if you need additional information or have any 1.11 questions. 1.12 --> 1.13 + 1.14 <project name="nashorn" default="test" basedir=".."> 1.15 <import file="build-nasgen.xml"/> 1.16 - <import file="build-benchmark.xml"/> 1.17 <import file="code_coverage.xml"/> 1.18 1.19 - 1.20 <target name="init-conditions"> 1.21 <!-- loading locally defined resources and properties. NB they owerwrite default ones defined later --> 1.22 <property file="${user.home}/.nashorn.project.local.properties"/> 1.23 @@ -51,7 +51,7 @@ 1.24 <available property="testng.available" file="${file.reference.testng.jar}"/> 1.25 <!-- check if Jemmy ang testng.jar are avaiable --> 1.26 <condition property="jemmy.jfx.testng.available" value="true"> 1.27 - <and> 1.28 + <and> 1.29 <available file="${file.reference.jemmyfx.jar}"/> 1.30 <available file="${file.reference.jemmycore.jar}"/> 1.31 <available file="${file.reference.jemmyawtinput.jar}"/> 1.32 @@ -69,13 +69,16 @@ 1.33 <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt"> 1.34 <istrue value="${make.code.coverage}" /> 1.35 </condition> 1.36 + 1.37 + <condition property="jfr.options" value="${run.test.jvmargs.jfr}" else=""> 1.38 + <istrue value="${jfr}"/> 1.39 + </condition> 1.40 </target> 1.41 1.42 <target name="init" depends="init-conditions, init-cc"> 1.43 - 1.44 <!-- extends jvm args --> 1.45 - <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs}"/> 1.46 - <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs}" /> 1.47 + <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/> 1.48 + <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/> 1.49 1.50 <echo message="run.test.jvmargs=${run.test.jvmargs}"/> 1.51 <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/> 1.52 @@ -122,8 +125,7 @@ 1.53 encoding="${javac.encoding}" 1.54 includeantruntime="false" fork="true"> 1.55 <compilerarg value="-J-Djava.ext.dirs="/> 1.56 - <compilerarg value="-Xlint:unchecked"/> 1.57 - <compilerarg value="-Xlint:deprecation"/> 1.58 + <compilerarg value="-Xlint:all"/> 1.59 <compilerarg value="-XDignore.symbol.file"/> 1.60 <compilerarg value="-Xdiags:verbose"/> 1.61 </javac> 1.62 @@ -291,6 +293,10 @@ 1.63 <target name="generate-policy-file" depends="prepare"> 1.64 <echo file="${build.dir}/nashorn.policy"> 1.65 1.66 +grant codeBase "file:/${toString:nashorn.ext.path}/nashorn.jar" { 1.67 + permission java.security.AllPermission; 1.68 +}; 1.69 + 1.70 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" { 1.71 permission java.security.AllPermission; 1.72 }; 1.73 @@ -298,6 +304,14 @@ 1.74 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" { 1.75 permission java.security.AllPermission; 1.76 }; 1.77 +//// in case of absolute path: 1.78 +grant codeBase "file:/${nashorn.internal.tests.jar}" { 1.79 + permission java.security.AllPermission; 1.80 +}; 1.81 + 1.82 +grant codeBase "file:/${file.reference.testng.jar}" { 1.83 + permission java.security.AllPermission; 1.84 +}; 1.85 1.86 grant codeBase "file:/${basedir}/test/script/trusted/*" { 1.87 permission java.security.AllPermission; 1.88 @@ -330,6 +344,10 @@ 1.89 permission java.lang.RuntimePermission "nashorn.JavaReflection"; 1.90 }; 1.91 1.92 +grant codeBase "file:/${basedir}/test/script/markdown.js" { 1.93 + permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read"; 1.94 +}; 1.95 + 1.96 </echo> 1.97 1.98 <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace> <!--hack for Windows - to make URLs with normal path separators --> 1.99 @@ -345,6 +363,7 @@ 1.100 <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/> 1.101 <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/> 1.102 <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/> 1.103 + <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/> 1.104 </target> 1.105 1.106 <target name="check-testng" unless="testng.available"> 1.107 @@ -380,7 +399,8 @@ 1.108 <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes" 1.109 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> 1.110 <jvmarg line="${ext.class.path}"/> 1.111 - <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/> 1.112 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/> 1.113 + <sysproperty key="nashorn.jar" value="${dist.dir}/nashorn.jar"/> 1.114 <propertyset> 1.115 <propertyref prefix="nashorn."/> 1.116 </propertyset> 1.117 @@ -401,9 +421,12 @@ 1.118 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes" 1.119 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> 1.120 <jvmarg line="${ext.class.path}"/> 1.121 - <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/> 1.122 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/> 1.123 <jvmarg line="${debug.test.jvmargs}"/> 1.124 <propertyset> 1.125 + <propertyref prefix="nashorn."/> 1.126 + </propertyset> 1.127 + <propertyset> 1.128 <propertyref prefix="test-sys-prop."/> 1.129 <mapper from="test-sys-prop.*" to="*" type="glob"/> 1.130 </propertyset> 1.131 @@ -416,18 +439,6 @@ 1.132 1.133 <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"/> 1.134 1.135 - <target name="test-basicparallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file"> 1.136 - <!-- use just build.test.classes.dir to avoid referring to TestNG --> 1.137 - <java classname="${parallel.test.runner}" dir="${basedir}" classpath="${build.test.classes.dir}" failonerror="true" fork="true"> 1.138 - <jvmarg line="${ext.class.path}"/> 1.139 - <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/> 1.140 - <syspropertyset> 1.141 - <propertyref prefix="test-sys-prop."/> 1.142 - <mapper type="glob" from="test-sys-prop.*" to="*"/> 1.143 - </syspropertyset> 1.144 - </java> 1.145 - </target> 1.146 - 1.147 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available"> 1.148 <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."/> 1.149 </target> 1.150 @@ -436,19 +447,19 @@ 1.151 <fileset id="test.classes" dir="${build.test.classes.dir}"> 1.152 <include name="**/framework/*Test.class"/> 1.153 </fileset> 1.154 - 1.155 + 1.156 <copy file="${file.reference.jfxrt.jar}" todir="dist"/> 1.157 - 1.158 + 1.159 <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" "> 1.160 - <not> 1.161 + <not> 1.162 <os family="mac"/> 1.163 </not> 1.164 - </condition> 1.165 - 1.166 + </condition> 1.167 + 1.168 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes" 1.169 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> 1.170 <jvmarg line="${ext.class.path}"/> 1.171 - <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/> 1.172 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/> 1.173 <propertyset> 1.174 <propertyref prefix="testjfx-test-sys-prop."/> 1.175 <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/> 1.176 @@ -459,7 +470,26 @@ 1.177 </classpath> 1.178 </testng> 1.179 </target> 1.180 - 1.181 + 1.182 + <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available"> 1.183 + <fileset id="test.classes" dir="${build.test.classes.dir}"> 1.184 + <include name="**/framework/*Test.class"/> 1.185 + </fileset> 1.186 + 1.187 + <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes" 1.188 + verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> 1.189 + <jvmarg line="${ext.class.path}"/> 1.190 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/> 1.191 + <propertyset> 1.192 + <propertyref prefix="testmarkdown-test-sys-prop."/> 1.193 + <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/> 1.194 + </propertyset> 1.195 + <classpath> 1.196 + <pathelement path="${run.test.classpath}"/> 1.197 + </classpath> 1.198 + </testng> 1.199 + </target> 1.200 + 1.201 <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available"> 1.202 <fileset id="test.classes" dir="${build.test.classes.dir}"> 1.203 <include name="**/framework/*Test.class"/> 1.204 @@ -468,7 +498,10 @@ 1.205 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes" 1.206 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}"> 1.207 <jvmarg line="${ext.class.path}"/> 1.208 - <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/> 1.209 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/> 1.210 + <propertyset> 1.211 + <propertyref prefix="nashorn."/> 1.212 + </propertyset> 1.213 <propertyset> 1.214 <propertyref prefix="test262-test-sys-prop."/> 1.215 <mapper from="test262-test-sys-prop.*" to="*" type="glob"/> 1.216 @@ -485,7 +518,9 @@ 1.217 <!-- use just build.test.classes.dir to avoid referring to TestNG --> 1.218 <java classname="${parallel.test.runner}" dir="${basedir}" fork="true"> 1.219 <jvmarg line="${ext.class.path}"/> 1.220 - <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/> 1.221 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/> 1.222 + <!-- avoid too many typeinfo cache files. Each script is run only once anyway --> 1.223 + <jvmarg line="-Dnashorn.typeInfo.disabled=true"/> 1.224 <classpath> 1.225 <pathelement path="${run.test.classpath}"/> 1.226 </classpath> 1.227 @@ -496,6 +531,26 @@ 1.228 </java> 1.229 </target> 1.230 1.231 + <target name="testparallel" depends="test-parallel"/> 1.232 + 1.233 + <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available"> 1.234 + <!-- use just build.test.classes.dir to avoid referring to TestNG --> 1.235 + <java classname="${parallel.test.runner}" dir="${basedir}" 1.236 + failonerror="true" 1.237 + fork="true"> 1.238 + <jvmarg line="${ext.class.path}"/> 1.239 + <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/> 1.240 + <classpath> 1.241 + <pathelement path="${run.test.classpath}"/> 1.242 + <pathelement path="${build.test.classes.dir}"/> 1.243 + </classpath> 1.244 + <syspropertyset> 1.245 + <propertyref prefix="test-sys-prop."/> 1.246 + <mapper type="glob" from="test-sys-prop.*" to="*"/> 1.247 + </syspropertyset> 1.248 + </java> 1.249 + </target> 1.250 + 1.251 <target name="all" depends="test, docs" 1.252 description="Build, test and generate docs for nashorn"/> 1.253 1.254 @@ -529,6 +584,8 @@ 1.255 <!-- clone test262 git repo --> 1.256 <exec executable="${git.executable}"> 1.257 <arg value="clone"/> 1.258 + <arg value="--branch"/> 1.259 + <arg value="es5-tests"/> 1.260 <arg value="https://github.com/tc39/test262"/> 1.261 <arg value="${test.external.dir}/test262"/> 1.262 </exec> 1.263 @@ -604,6 +661,11 @@ 1.264 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/> 1.265 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/> 1.266 1.267 + <!-- showdown --> 1.268 + <mkdir dir="${test.external.dir}/showdown"/> 1.269 + <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/> 1.270 + <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/> 1.271 + 1.272 </target> 1.273 1.274 <!-- update external test suites that are pulled from source control systems --> 1.275 @@ -619,4 +681,6 @@ 1.276 1.277 <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/> 1.278 1.279 + <import file="build-benchmark.xml"/> 1.280 + 1.281 </project>