test/README

Fri, 05 Jun 2015 12:38:53 +0200

author
mhaupt
date
Fri, 05 Jun 2015 12:38:53 +0200
changeset 1398
2f1b9f4daec1
parent 0
b1a7da25b547
permissions
-rw-r--r--

8080087: Nashorn $ENV.PWD is originally undefined
Summary: On Windows, the PWD environment variable does not exist and cannot be imported in scripting mode, so it is set explicitly.
Reviewed-by: lagergren, sundar

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

mercurial