5 This is a test suite primarily for testing the SpiderMonkey JIT, GC, and any
6 other internal mechanisms that are not visible to test262. All tests are run in
9 In the future, we intend to migrate the "non262" jstests over to this framework.
11 * CONTINUOUS INTEGRATION
13 In CI, these tests will be run as part of the "SM(...)" set of jobs. They will
14 also be packaged up and then run via mozharness as separate test jobs on some
15 platforms. These will appear on treeherder as jobs starting with "Jit", eg
16 "Jit", "Jit3", "Jit-1proc3", etc.
18 Unlike jstests, we do not run jit-tests in the browser. All tests may assume
19 they are running in the JS shell environment.
23 Python 3.7. This is already a standard requirement for building our tree.
31 from the top of the checkout. Directly invoking
33 python jit_test.py <path-to-js-shell>
35 will also work. The progress bar shows [#tests passed, #tests failed, #tests
36 run] at the left. If all tests pass, the output is 'PASSED ALL'. The test suite
37 can be interrupted at any time with Ctrl+C and partial results will be printed.
39 To run only the basic tests, not including the slow tests:
41 ./mach jit-test <path-to-js-shell> basic
51 for the jit-test harness options, or
55 for the mach driver's options (eg --cgc).
59 Simply create a JS file under the 'tests/' directory. Most tests should go in
62 All tests are run with 'lib/prologue.js' included first on the command line. The
63 command line also creates a global variable 'libdir' that is set to the path
64 of the 'lib' directory. To include a file 'foo.js' from the lib directory in a
67 load(libdir + 'foo.js')
71 The first line of a test case can contain a special comment controlling how the
72 test is run. For example:
74 // |jit-test| allow-oom; --no-threads
76 The general format in EBNF is:
78 metaline ::= cookie { item ";" }
79 cookie ::= "|jit-test|"
80 item ::= flag | attribute
82 flag ::= "slow" | "allow-oom" | "valgrind" | "tz-pacific" | "debug" |
85 attribute ::= name ":" value
86 name ::= "error" | "exitstatus"
90 The metaline may appear anywhere in the first line of the file: this allows it
91 to be placed inside any kind of comment.
93 The meaning of the items:
95 slow Test runs slowly. Do not run if the --no-slow option is given.
96 allow-oom If the test runs out of memory, it counts as passing.
97 valgrind Run test under valgrind.
98 tz-pacific Always run test with the Pacific time zone (TZ=PST8PDT).
100 error The test should be considered to pass iff it throws the
102 exitstatus The test should exit with the given status value (an integer).
104 debug Run js with -d, whether --jitflags says to or not
105 --SWITCH Pass --SWITCH through to js