make/build.xml

changeset 1741
a136c901f3f5
parent 1648
ab5cb7c26321
child 1742
fe6ef89d9c04
equal deleted inserted replaced
1740:6ff7a094ba60 1741:a136c901f3f5
47 <available file="/usr/local/bin/hg"/> 47 <available file="/usr/local/bin/hg"/>
48 </condition> 48 </condition>
49 <condition property="git.executable" value="/usr/local/bin/git" else="git"> 49 <condition property="git.executable" value="/usr/local/bin/git" else="git">
50 <available file="/usr/local/bin/git"/> 50 <available file="/usr/local/bin/git"/>
51 </condition> 51 </condition>
52 <!-- check if testng.jar is avaiable --> 52 <!-- check if TestNG and dependencies are available, and download them if they aren't -->
53 <available property="testng.available" file="${file.reference.testng.jar}"/> 53 <antcall target="get-testng"/>
54 <!-- check if Jemmy ang testng.jar are avaiable --> 54 <condition property="testng.available" value="true">
55 <and>
56 <available file="${file.reference.testng.jar}"/>
57 <available file="${file.reference.jcommander.jar}"/>
58 <available file="${file.reference.bsh.jar}"/>
59 <available file="${file.reference.snakeyaml.jar}"/>
60 </and>
61 </condition>
62 <!-- check if Jemmy ang TestNG are avaiable -->
55 <condition property="jemmy.jfx.testng.available" value="true"> 63 <condition property="jemmy.jfx.testng.available" value="true">
56 <and> 64 <and>
57 <available file="${file.reference.jemmyfx.jar}"/> 65 <available file="${file.reference.jemmyfx.jar}"/>
58 <available file="${file.reference.jemmycore.jar}"/> 66 <available file="${file.reference.jemmycore.jar}"/>
59 <available file="${file.reference.jemmyawtinput.jar}"/> 67 <available file="${file.reference.jemmyawtinput.jar}"/>
273 </target> 281 </target>
274 282
275 <target name="compile-test" depends="compile, run-nasgen" if="testng.available"> 283 <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
276 <!-- testng task --> 284 <!-- testng task -->
277 <taskdef name="testng" classname="org.testng.TestNGAntTask" 285 <taskdef name="testng" classname="org.testng.TestNGAntTask"
278 classpath="${file.reference.testng.jar}"/> 286 classpath="${testng.ant.classpath}"/>
279 287
280 <javac srcdir="${test.src.dir}" 288 <javac srcdir="${test.src.dir}"
281 destdir="${build.test.classes.dir}" 289 destdir="${build.test.classes.dir}"
282 classpath="${javac.test.classpath}" 290 classpath="${javac.test.classpath}"
283 source="${test.javac.source}" 291 source="${test.javac.source}"
329 }; 337 };
330 338
331 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" { 339 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
332 permission java.security.AllPermission; 340 permission java.security.AllPermission;
333 }; 341 };
342 grant codeBase "file:/${basedir}/${file.reference.jcommander.jar}" {
343 permission java.security.AllPermission;
344 };
345 grant codeBase "file:/${basedir}/${file.reference.bsh.jar}" {
346 permission java.security.AllPermission;
347 };
348 grant codeBase "file:/${basedir}/${file.reference.snakeyaml.jar}" {
349 permission java.security.AllPermission;
350 };
334 //// in case of absolute path: 351 //// in case of absolute path:
335 grant codeBase "file:/${nashorn.internal.tests.jar}" { 352 grant codeBase "file:/${nashorn.internal.tests.jar}" {
336 permission java.security.AllPermission; 353 permission java.security.AllPermission;
337 }; 354 };
338 355
339 grant codeBase "file:/${file.reference.testng.jar}" { 356 grant codeBase "file:/${file.reference.testng.jar}" {
340 permission java.security.AllPermission; 357 permission java.security.AllPermission;
341 }; 358 };
359 grant codeBase "file:/${file.reference.jcommander.jar}" {
360 permission java.security.AllPermission;
361 };
362 grant codeBase "file:/${file.reference.bsh.jar}" {
363 permission java.security.AllPermission;
364 };
365 grant codeBase "file:/${file.reference.snakeyaml.jar}" {
366 permission java.security.AllPermission;
367 };
368
342 369
343 grant codeBase "file:/${basedir}/test/script/trusted/*" { 370 grant codeBase "file:/${basedir}/test/script/trusted/*" {
344 permission java.security.AllPermission; 371 permission java.security.AllPermission;
345 }; 372 };
346 373
406 <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/> 433 <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
407 <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/> 434 <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/>
408 </target> 435 </target>
409 436
410 <target name="check-testng" unless="testng.available"> 437 <target name="check-testng" unless="testng.available">
411 <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under ${test.lib} directory."/> 438 <echo message="WARNING: TestNG not available, will not run tests. Please copy TestNG and dependency JARs to the ${test.lib} directory."/>
412 </target> 439 </target>
413 440
414 <!-- only to be invoked as dependency of "test" target --> 441 <!-- only to be invoked as dependency of "test" target -->
415 <target name="-test-classes-all" depends="jar" unless="test.class"> 442 <target name="-test-classes-all" depends="jar" unless="test.class">
416 <fileset id="test.classes" dir="${build.test.classes.dir}"> 443 <fileset id="test.classes" dir="${build.test.classes.dir}">
478 <pathelement path="${run.test.classpath}"/> 505 <pathelement path="${run.test.classpath}"/>
479 </classpath> 506 </classpath>
480 </testng> 507 </testng>
481 </target> 508 </target>
482 509
483 <target name="test" depends="get-testng, javadocnh, test-pessimistic, test-optimistic"/> 510 <target name="test" depends="prepare, javadocnh, test-pessimistic, test-optimistic"/>
484 511
485 <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"> 512 <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">
486 <echo message="Running test suite in OPTIMISTIC mode..."/> 513 <echo message="Running test suite in OPTIMISTIC mode..."/>
487 <antcall target="-test-nosecurity" inheritRefs="true"> 514 <antcall target="-test-nosecurity" inheritRefs="true">
488 <param name="optimistic" value="true"/> 515 <param name="optimistic" value="true"/>
505 <param name="testResultsSubDir" value="pessimistic"/> 532 <param name="testResultsSubDir" value="pessimistic"/>
506 </antcall> 533 </antcall>
507 </target> 534 </target>
508 535
509 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available"> 536 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
510 <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."/> 537 <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy TestNG and dependency JARs, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar to the test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
511 </target> 538 </target>
512 539
513 <target name="testjfx" depends="jar, get-testng, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available"> 540 <target name="testjfx" depends="jar, get-testng, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
514 <fileset id="test.classes" dir="${build.test.classes.dir}"> 541 <fileset id="test.classes" dir="${build.test.classes.dir}">
515 <include name="**/framework/*Test.class"/> 542 <include name="**/framework/*Test.class"/>
740 767
741 <!-- run all perf tests --> 768 <!-- run all perf tests -->
742 <target name="perf" depends="externals, update-externals, sunspider, octane"/> 769 <target name="perf" depends="externals, update-externals, sunspider, octane"/>
743 770
744 <!-- download and install testng.jar --> 771 <!-- download and install testng.jar -->
745 <target name="get-testng" depends="prepare" unless="testng.available"> 772 <target name="get-testng">
746 <get src="http://testng.org/testng-6.8.zip" dest="${test.lib}" skipexisting="true" ignoreerrors="true"/> 773 <get dest="${test.lib}" skipexisting="true">
747 <unzip src="${test.lib}${file.separator}testng-6.8.zip" dest="${test.lib}"> 774 <url url="http://central.maven.org/maven2/org/testng/testng/6.8/testng-6.8.jar"/>
748 <patternset> 775 <url url="http://central.maven.org/maven2/com/beust/jcommander/1.27/jcommander-1.27.jar"/>
749 <include name="testng-6.8/testng-6.8.jar"/> 776 <url url="http://central.maven.org/maven2/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
750 </patternset> 777 <url url="http://central.maven.org/maven2/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar"/>
751 </unzip> 778 </get>
752 <move file="${test.lib}${file.separator}testng-6.8${file.separator}testng-6.8.jar" tofile="${test.lib}${file.separator}testng.jar"/>
753 <delete dir="${test.lib}${file.separator}testng-6.8"/>
754 </target> 779 </target>
755 780
756 <!-- run all tests --> 781 <!-- run all tests -->
757 <target name="alltests" depends="get-testng, externals, update-externals, test, test262parallel, testmarkdown, perf"/> 782 <target name="alltests" depends="get-testng, externals, update-externals, test, test262parallel, testmarkdown, perf"/>
758 783

mercurial