annotate test/README @ 700:78cdf566535d

8031106: Nashorn: IndexOutOfBoundsException in NashornCallSiteDescriptor.getNameToken() Reviewed-by: hannesw, jlaskey
author sundar
date Fri, 03 Jan 2014 10:09:48 +0530
parents da1e581c933b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
1 Nashorn tests are TestNG based. Running tests requires downloading the TestNG
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
2 library and placing its jar file into the lib subdirectory:
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
3
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
4 # download and install TestNG
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
5 wget http://testng.org/testng-x.y.z.zip
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
6 unzip testng-x.y.z.zip
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
7 cp testng-x.y.z/testng-x.y.z.jar lib/testng.jar
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
8
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
9 # run tests
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
10 cd ..
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
11 ant test
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
12
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
13 This will fail with a message like
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
14
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
15 taskdef class org.testng.TestNGAntTask cannot be found
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
16
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
17 if the TestNG jar file is not installed properly or if the wrong
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
18 version is present. (Check build.xml to find the version of TestNG
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
19 that is required.) Only the jar file is necessary. The unzipped
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
20 hierarchy can be removed.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
21
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
22 We have tested using TestNG 6.7 as well ad TestNG 6.8. TestNG 6.7's jar file
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
23 is also available as part of jtreg 4.1 b05 which can be downloaded at
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
24 http://download.java.net/openjdk/jtreg/
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
25
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
26 ECMAScript script test framework:
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
27
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
28 * Test tags for test framework:
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
29
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
30 The test runner crawls these directories for .js files and looks for JTReg-style
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
31 @foo comments to identify tests.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
32
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
33 * @test - A test is tagged with @test.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
34
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
35 * @test/fail - Tests that are supposed to fail (compiling, see @run/fail
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
36 for runtime) are tagged with @test/fail.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
37
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
38 * @test/compile-error - Test expects compilation to fail, compares
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
39 output.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
40
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
41 * @test/warning - Test expects compiler warnings, compares output.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
42
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
43 * @test/nocompare - Test expects to compile [and/or run?]
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
44 successfully(may be warnings), does not compare output.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
45
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
46 * @subtest - denotes necessary file for a main test file; itself is not
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
47 a test.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
48
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
49 * @run - A test that should be run is also tagged with @run (otherwise
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
50 the test runner only compiles the test).
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
51
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
52 * @runif - A test that should be run only if a specific System property
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
53 is defined (Example: @runif external.v8)
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
54
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
55 * @run/fail - A test that should compile but fail with a runtime error.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
56
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
57 * @run/param - specify runtime arguments to script.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
58
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
59 * @run/ignore-std-error - script may produce output on stderr, ignore
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
60 this output.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
61
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
62 * @compilearg \ - pass arg to compiler, sample.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
63
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
64 /**
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
65 * @compilearg --dump-ir-graph
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
66 * @test/warning
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
67 */
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
68
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
69 * @compilefirst foo.js - foo.js being a necessary file for a test; it
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
70 may or may not itself be a test. These are compiled separately before
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
71 main test file.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
72
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
73 * @compile/fail foo.js - foo.js being a necessary file for a test; it
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
74 may or may not itself be a test, compile should fail. These are compile
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
75 with main file.
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
76
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
77 * @compile bar.js - bar.js being a necessary file for a test; it may or
da1e581c933b 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
78 may not itself be a test. These are compiled with main file.