8131142: late-bind check for testng.jar presence in Nashorn test execution
authormhaupt
Wed, 22 Jul 2015 09:28:28 +0200
changeset 31829 fa5c0e50b2cf
parent 31828 50189d0dacb0
child 31830 1e145ba49d48
8131142: late-bind check for testng.jar presence in Nashorn test execution Reviewed-by: hannesw, sundar
nashorn/make/build.xml
--- a/nashorn/make/build.xml	Wed Jul 22 10:18:33 2015 +0200
+++ b/nashorn/make/build.xml	Wed Jul 22 09:28:28 2015 +0200
@@ -48,7 +48,9 @@
     <condition property="git.executable" value="/usr/local/bin/git" else="git">
       <available file="/usr/local/bin/git"/>
     </condition>
-    <!-- check if testng.jar is avaiable -->
+    <!-- check if testng.jar is avaiable, and download it if it isn't -->
+    <available property="testng.already.present" file="${file.reference.testng.jar}"/>
+    <antcall target="get-testng"/>
     <available property="testng.available" file="${file.reference.testng.jar}"/>
     <!-- check if Jemmy ang testng.jar are avaiable -->
     <condition property="jemmy.jfx.testng.available" value="true">
@@ -484,7 +486,7 @@
     </testng>
   </target>
 
-  <target name="test" depends="get-testng, javadocnh, test-pessimistic, test-optimistic"/>
+  <target name="test" depends="prepare, javadocnh, test-pessimistic, test-optimistic"/>
 
   <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">
     <echo message="Running test suite in OPTIMISTIC mode..."/>
@@ -514,7 +516,7 @@
     <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."/>
   </target>
 
-  <target name="testjfx" depends="jar, get-testng, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
+  <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
     </fileset>
@@ -542,7 +544,7 @@
     </testng>
   </target>
 
-  <target name="testmarkdown" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
     </fileset>
@@ -561,7 +563,7 @@
     </testng>
   </target>
 
-  <target name="test262" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
     </fileset>
@@ -585,7 +587,7 @@
 
   <target name="test262parallel" depends="test262-parallel"/>
 
-  <target name="test262-parallel" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
       <jvmarg line="${boot.class.path}"/>
@@ -604,7 +606,7 @@
 
   <target name="testparallel" depends="test-parallel"/>
 
-  <target name="test-parallel" depends="jar, get-testng, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
       <java classname="${parallel.test.runner}" dir="${basedir}"
         failonerror="true"
@@ -709,7 +711,7 @@
   </target>
 
   <!-- get all external test scripts -->
-  <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider, get-testng">
+  <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider">
     <!-- make external test dir -->
     <mkdir dir="${test.external.dir}"/>
 
@@ -746,7 +748,7 @@
   <target name="perf" depends="externals, update-externals, sunspider, octane"/>
 
   <!-- download and install testng.jar -->
-  <target name="get-testng" depends="prepare" unless="testng.available">
+  <target name="get-testng" unless="testng.already.present">
     <get src="http://testng.org/testng-6.8.zip" dest="${test.lib}" skipexisting="true" ignoreerrors="true"/>
     <unzip src="${test.lib}${file.separator}testng-6.8.zip" dest="${test.lib}">
       <patternset>
@@ -758,7 +760,7 @@
   </target>
 
   <!-- run all tests -->
-  <target name="alltests" depends="get-testng, externals, update-externals, test, test262parallel, testmarkdown, perf"/>
+  <target name="alltests" depends="externals, update-externals, test, test262parallel, testmarkdown, perf"/>
 
   <import file="build-benchmark.xml"/>