5 This is a test suite for testing TraceMonkey. All tests are run in the JS shell
6 with tracing enabled (-j).
10 Python 2.5. This is already a standard requirement for building our tree.
16 python jit_test.py <path-to-js-shell>
18 The progress bar shows [#tests passed, #tests failed, #tests run] at the left.
19 If all tests pass, the output is 'PASSED ALL'. The test suite can be interrupted
20 at any time with Ctrl+C and partial results will be printed.
22 To run only the basic tests, not including the slow tests:
24 python jit_test.py <path-to-js-shell> basic
32 Simply create a JS file under the 'tests/' directory. Most tests should go in
35 All tests are run with 'lib/prolog.js' included first on the command line. The
36 command line also creates a global variable 'libdir' that is set to the path
37 of the 'lib' directory. To include a file 'foo.js' from the lib directory in a
40 load(libdir + 'foo.js')
44 The first line of a test case can contain a special comment controlling how the
45 test is run. For example:
47 // |jit-test| allow-oom;
49 The general format in EBNF is:
51 metaline ::= cookie { item ";" }
52 cookie ::= "|jit-test|"
53 item ::= flag | attribute
55 flag ::= "slow" | "allow-oom"
57 attribute ::= name ":" value
58 name ::= "TMFLAGS" | "error"
61 The metaline may appear anywhere in the first line of the file: this allows it
62 to be placed inside any kind of comment.
64 The meaning of the items:
66 slow Test runs slowly. Do not run if the --no-slow option is given.
67 allow-oom If the test runs out of memory, it counts as passing.
68 valgrind Run test under valgrind.
70 error The test should be considered to pass iff it throws the
72 TMFLAGS Set the environment variable TMFLAGS to the given value.