1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/README Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,81 @@ 1.4 +JS Trace Test Suite 1.5 + 1.6 +* PURPOSE 1.7 + 1.8 +This is a test suite for testing TraceMonkey. All tests are run in the JS shell 1.9 +with tracing enabled (-j). 1.10 + 1.11 +* REQUIREMENTS 1.12 + 1.13 +Python 2.5. This is already a standard requirement for building our tree. 1.14 + 1.15 +* RUNNING THE TESTS 1.16 + 1.17 +Basic usage: 1.18 + 1.19 + python jit_test.py <path-to-js-shell> 1.20 + 1.21 +The progress bar shows [#tests passed, #tests failed, #tests run] at the left. 1.22 +If all tests pass, the output is 'PASSED ALL'. The test suite can be interrupted 1.23 +at any time with Ctrl+C and partial results will be printed. 1.24 + 1.25 +To run only the basic tests, not including the slow tests: 1.26 + 1.27 + python jit_test.py <path-to-js-shell> basic 1.28 + 1.29 +For more options: 1.30 + 1.31 + python jit_test.py -h 1.32 + 1.33 +* CREATING NEW TESTS 1.34 + 1.35 +Simply create a JS file under the 'tests/' directory. Most tests should go in 1.36 +'tests/basic/'. 1.37 + 1.38 +All tests are run with 'lib/prolog.js' included first on the command line. The 1.39 +command line also creates a global variable 'libdir' that is set to the path 1.40 +of the 'lib' directory. To include a file 'foo.js' from the lib directory in a 1.41 +test case: 1.42 + 1.43 + load(libdir + 'foo.js') 1.44 + 1.45 +* TEST METALINES 1.46 + 1.47 +The first line of a test case can contain a special comment controlling how the 1.48 +test is run. For example: 1.49 + 1.50 + // |jit-test| allow-oom; 1.51 + 1.52 +The general format in EBNF is: 1.53 + 1.54 + metaline ::= cookie { item ";" } 1.55 + cookie ::= "|jit-test|" 1.56 + item ::= flag | attribute 1.57 + 1.58 + flag ::= "slow" | "allow-oom" | "valgrind" | "tz-pacific" | 1.59 + "ion-eager" | "debug" | 1.60 + "dump-bytecode" | 1.61 + 1.62 + 1.63 + attribute ::= name ":" value 1.64 + name ::= "error" | "exitstatus" 1.65 + value ::= <string> 1.66 + 1.67 +The metaline may appear anywhere in the first line of the file: this allows it 1.68 +to be placed inside any kind of comment. 1.69 + 1.70 +The meaning of the items: 1.71 + 1.72 + slow Test runs slowly. Do not run if the --no-slow option is given. 1.73 + allow-oom If the test runs out of memory, it counts as passing. 1.74 + valgrind Run test under valgrind. 1.75 + tz-pacific Always run test with the Pacific time zone (TZ=PST8PDT). 1.76 + ion-eager Run js with --ion-eager, whether --jitflags says to or not 1.77 + debug Run js with -d, whether --jitflags says to or not 1.78 + dump-bytecode Run js with -D, whether --jitflags says to or not 1.79 + 1.80 + error The test should be considered to pass iff it throws the 1.81 + given JS exception. 1.82 + exitstatus The test should exit with the given status value (an integer). 1.83 + 1.84 +* END