aoqi@0: Nashorn tests are TestNG based. Running tests requires downloading the TestNG aoqi@0: library and placing its jar file into the lib subdirectory: aoqi@0: aoqi@0: # download and install TestNG aoqi@0: wget http://testng.org/testng-x.y.z.zip aoqi@0: unzip testng-x.y.z.zip aoqi@0: cp testng-x.y.z/testng-x.y.z.jar lib/testng.jar aoqi@0: aoqi@0: # run tests aoqi@0: cd .. aoqi@0: ant test aoqi@0: aoqi@0: This will fail with a message like aoqi@0: aoqi@0: taskdef class org.testng.TestNGAntTask cannot be found aoqi@0: aoqi@0: if the TestNG jar file is not installed properly or if the wrong aoqi@0: version is present. (Check build.xml to find the version of TestNG aoqi@0: that is required.) Only the jar file is necessary. The unzipped aoqi@0: hierarchy can be removed. aoqi@0: aoqi@0: We have tested using TestNG 6.7 as well ad TestNG 6.8. TestNG 6.7's jar file aoqi@0: is also available as part of jtreg 4.1 b05 which can be downloaded at aoqi@0: http://download.java.net/openjdk/jtreg/ aoqi@0: aoqi@0: ECMAScript script test framework: aoqi@0: aoqi@0: * Test tags for test framework: aoqi@0: aoqi@0: The test runner crawls these directories for .js files and looks for JTReg-style aoqi@0: @foo comments to identify tests. aoqi@0: aoqi@0: * @test - A test is tagged with @test. aoqi@0: aoqi@0: * @test/fail - Tests that are supposed to fail (compiling, see @run/fail aoqi@0: for runtime) are tagged with @test/fail. aoqi@0: aoqi@0: * @test/compile-error - Test expects compilation to fail, compares aoqi@0: output. aoqi@0: aoqi@0: * @test/warning - Test expects compiler warnings, compares output. aoqi@0: aoqi@0: * @test/nocompare - Test expects to compile [and/or run?] aoqi@0: successfully(may be warnings), does not compare output. aoqi@0: aoqi@0: * @subtest - denotes necessary file for a main test file; itself is not aoqi@0: a test. aoqi@0: aoqi@0: * @run - A test that should be run is also tagged with @run (otherwise aoqi@0: the test runner only compiles the test). aoqi@0: aoqi@0: * @runif - A test that should be run only if a specific System property aoqi@0: is defined (Example: @runif external.v8) aoqi@0: aoqi@0: * @run/fail - A test that should compile but fail with a runtime error. aoqi@0: aoqi@0: * @run/param - specify runtime arguments to script. aoqi@0: aoqi@0: * @run/ignore-std-error - script may produce output on stderr, ignore aoqi@0: this output. aoqi@0: aoqi@0: * @compilearg \ - pass arg to compiler, sample. aoqi@0: aoqi@0: /** aoqi@0: * @compilearg --dump-ir-graph aoqi@0: * @test/warning aoqi@0: */ aoqi@0: aoqi@0: * @compilefirst foo.js - foo.js being a necessary file for a test; it aoqi@0: may or may not itself be a test. These are compiled separately before aoqi@0: main test file. aoqi@0: aoqi@0: * @compile/fail foo.js - foo.js being a necessary file for a test; it aoqi@0: may or may not itself be a test, compile should fail. These are compile aoqi@0: with main file. aoqi@0: aoqi@0: * @compile bar.js - bar.js being a necessary file for a test; it may or aoqi@0: may not itself be a test. These are compiled with main file.