• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

etc/H03-May-2022-

lib/H03-May-2022-

manual-tests/H03-May-2022-

modules/H03-May-2022-

tests/H03-May-2022-7862

READMEH A D01-Sep-20192.3 KiB8151

jit_test.pyH A D01-Sep-201916.5 KiB386307

README

1JS Trace Test Suite
2
3* PURPOSE
4
5This is a test suite for testing the SpiderMonkey JIT. All tests are run in the JS shell
6with tracing enabled (-j).
7
8* REQUIREMENTS
9
10Python 2.7. This is already a standard requirement for building our tree.
11
12* RUNNING THE TESTS
13
14Basic usage:
15
16    python jit_test.py <path-to-js-shell>
17
18The progress bar shows [#tests passed, #tests failed, #tests run] at the left.
19If all tests pass, the output is 'PASSED ALL'. The test suite can be interrupted
20at any time with Ctrl+C and partial results will be printed.
21
22To run only the basic tests, not including the slow tests:
23
24    python jit_test.py <path-to-js-shell> basic
25
26For more options:
27
28    python jit_test.py -h
29
30* CREATING NEW TESTS
31
32Simply create a JS file under the 'tests/' directory. Most tests should go in
33'tests/basic/'.
34
35All tests are run with 'lib/prologue.js' included first on the command line. The
36command line also creates a global variable 'libdir' that is set to the path
37of the 'lib' directory. To include a file 'foo.js' from the lib directory in a
38test case:
39
40    load(libdir + 'foo.js')
41
42* TEST METALINES
43
44The first line of a test case can contain a special comment controlling how the
45test is run. For example:
46
47    // |jit-test| allow-oom; --no-threads
48
49The general format in EBNF is:
50
51    metaline  ::= cookie { item ";" }
52    cookie    ::= "|jit-test|"
53    item      ::= flag | attribute
54
55    flag      ::= "slow" | "allow-oom" | "valgrind" | "tz-pacific" | "debug" |
56                  "--" switch
57
58    attribute ::= name ":" value
59    name      ::= "error" | "exitstatus"
60    value     ::= <string>
61    switch    ::= <string>
62
63The metaline may appear anywhere in the first line of the file: this allows it
64to be placed inside any kind of comment.
65
66The meaning of the items:
67
68    slow         Test runs slowly. Do not run if the --no-slow option is given.
69    allow-oom    If the test runs out of memory, it counts as passing.
70    valgrind     Run test under valgrind.
71    tz-pacific   Always run test with the Pacific time zone (TZ=PST8PDT).
72
73    error        The test should be considered to pass iff it throws the
74                 given JS exception.
75    exitstatus   The test should exit with the given status value (an integer).
76
77    debug        Run js with -d, whether --jitflags says to or not
78    --SWITCH     Pass --SWITCH through to js
79
80* END
81