Thu, 20 Mar 2014 10:26:20 -0700
Merge
1 Nashorn tests are TestNG based. Running tests requires downloading the TestNG
2 library and placing its jar file into the lib subdirectory:
4 # download and install TestNG
5 wget http://testng.org/testng-x.y.z.zip
6 unzip testng-x.y.z.zip
7 cp testng-x.y.z/testng-x.y.z.jar lib/testng.jar
9 # run tests
10 cd ..
11 ant test
13 This will fail with a message like
15 taskdef class org.testng.TestNGAntTask cannot be found
17 if the TestNG jar file is not installed properly or if the wrong
18 version is present. (Check build.xml to find the version of TestNG
19 that is required.) Only the jar file is necessary. The unzipped
20 hierarchy can be removed.
22 We have tested using TestNG 6.7 as well ad TestNG 6.8. TestNG 6.7's jar file
23 is also available as part of jtreg 4.1 b05 which can be downloaded at
24 http://download.java.net/openjdk/jtreg/
26 ECMAScript script test framework:
28 * Test tags for test framework:
30 The test runner crawls these directories for .js files and looks for JTReg-style
31 @foo comments to identify tests.
33 * @test - A test is tagged with @test.
35 * @test/fail - Tests that are supposed to fail (compiling, see @run/fail
36 for runtime) are tagged with @test/fail.
38 * @test/compile-error - Test expects compilation to fail, compares
39 output.
41 * @test/warning - Test expects compiler warnings, compares output.
43 * @test/nocompare - Test expects to compile [and/or run?]
44 successfully(may be warnings), does not compare output.
46 * @subtest - denotes necessary file for a main test file; itself is not
47 a test.
49 * @run - A test that should be run is also tagged with @run (otherwise
50 the test runner only compiles the test).
52 * @runif - A test that should be run only if a specific System property
53 is defined (Example: @runif external.v8)
55 * @run/fail - A test that should compile but fail with a runtime error.
57 * @run/param - specify runtime arguments to script.
59 * @run/ignore-std-error - script may produce output on stderr, ignore
60 this output.
62 * @compilearg \ - pass arg to compiler, sample.
64 /**
65 * @compilearg --dump-ir-graph
66 * @test/warning
67 */
69 * @compilefirst foo.js - foo.js being a necessary file for a test; it
70 may or may not itself be a test. These are compiled separately before
71 main test file.
73 * @compile/fail foo.js - foo.js being a necessary file for a test; it
74 may or may not itself be a test, compile should fail. These are compile
75 with main file.
77 * @compile bar.js - bar.js being a necessary file for a test; it may or
78 may not itself be a test. These are compiled with main file.