gecko-dev/js/src/jit-test
2011-09-02 16:52:13 -05:00
..
lib New rule: a Debug object cannot be attached to a compartment that is not in debug mode. Includes a jsapi-test to check that we do not crash if you turn debug mode off while a Debug object is already attached. (This changeset moves all the Debug object tests under jit-tests because the jit-test runner lets tests ask for debug mode.) 2011-04-27 17:37:14 -05:00
tests Bug 677957 - Fix peculiarly dynamically-nested for-in loops. ("Assertion failure: !cx->iterValue.isMagic(JS_NO_ITER_VALUE), at jsiter.cpp:1017") r=dvander. 2011-09-02 16:52:13 -05:00
jit_test.py Revert to 6840fbf4dcdd 2011-07-08 17:58:10 -07:00
progressbar.py Bug 605374 - rename trace-tests (2nd attempt). r=dmandelin. 2010-10-20 20:40:51 -07:00
README New rule: a Debug object cannot be attached to a compartment that is not in debug mode. Includes a jsapi-test to check that we do not crash if you turn debug mode off while a Debug object is already attached. (This changeset moves all the Debug object tests under jit-tests because the jit-test runner lets tests ask for debug mode.) 2011-04-27 17:37:14 -05:00

JS Trace Test Suite

* PURPOSE

This is a test suite for testing TraceMonkey. All tests are run in the JS shell
with tracing enabled (-j).

* REQUIREMENTS

Python 2.5. This is already a standard requirement for building our tree.

* RUNNING THE TESTS

Basic usage:

    python jit_test.py <path-to-js-shell>

The progress bar shows [#tests passed, #tests failed, #tests run] at the left.
If all tests pass, the output is 'PASSED ALL'. The test suite can be interrupted
at any time with Ctrl+C and partial results will be printed.

To run only the basic tests, not including the slow tests:

    python jit_test.py <path-to-js-shell> basic

For more options:

    python jit_test.py -h

* CREATING NEW TESTS

Simply create a JS file under the 'tests/' directory. Most tests should go in
'tests/basic/'.

All tests are run with 'lib/prolog.js' included first on the command line. The
command line also creates a global variable 'libdir' that is set to the path
of the 'lib' directory. To include a file 'foo.js' from the lib directory in a 
test case:

    load(libdir + 'foo.js')

* TEST METALINES

The first line of a test case can contain a special comment controlling how the
test is run. For example:

    // |jit-test| allow-oom;

The general format in EBNF is:

    metaline  ::= cookie { item ";" }
    cookie    ::= "|jit-test|"
    item      ::= flag | attribute

    flag      ::= "slow" | "allow-oom" | "valgrind" | "mjitalways" | "debug"

    attribute ::= name ":" value
    name      ::= "TMFLAGS" | "error"
    value     ::= <string>

The metaline may appear anywhere in the first line of the file: this allows it
to be placed inside any kind of comment.

The meaning of the items:

    slow         Test runs slowly. Do not run if the --no-slow option is given.
    allow-oom    If the test runs out of memory, it counts as passing.
    valgrind     Run test under valgrind.
    mjitalways   Run js with -a, whether --jitflags says to or not
    debug        Run js with -d, whether --jitflags says to or not

    error        The test should be considered to pass iff it throws the
                 given JS exception.
    TMFLAGS      Set the environment variable TMFLAGS to the given value.

* END