michael@0: JS Test Suite Readme michael@0: ==================== michael@0: michael@0: The JS test suite is a fairly extensive collection of correctness and regression michael@0: tests for the Spidermonkey engine. Two harnesses run these tests: the shell test michael@0: harness in this directory and the "reftest" harness built into the browser, used michael@0: by Tinderbox. The browser reftests require additional manifest files; these are michael@0: generated automatically by the build phase 'package-tests' using the michael@0: '--make-manifests' option to jstests.py. michael@0: michael@0: Creating a test michael@0: --------------- michael@0: For general information, see michael@0: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Creating_JavaScript_tests michael@0: michael@0: Adding a test michael@0: ------------- michael@0: Drop it in an appropriate directory under the tests directory. michael@0: michael@0: Some names are forbidden. Do not name your test browser.js, michael@0: shell.js, jsref.js, template.js, user.js, js-test-driver-begin.js, or michael@0: js-test-driver-end.js, or any of the names of the files in supporting/. michael@0: michael@0: michael@0: Adjusting when and how a test runs michael@0: ---------------------------------- michael@0: Put a comment at the top of the header matching the format: michael@0: // |reftest| -- michael@0: michael@0: Where is a standard reftest string, as documented by: michael@0: http://mxr.mozilla.org/mozilla-central/source/layout/tools/reftest/README.txt michael@0: michael@0: Example: michael@0: // |reftest| skip-if(!xulRuntime.shell) -- does not always dismiss alert michael@0: michael@0: Either // or /* */ style comments may be used. The entire michael@0: comment must appear in the first 512 bytes of the file. The control michael@0: string must be in its own comment block. michael@0: michael@0: When adding such comments to individual files is not feasible (e.g., for michael@0: imported tests), reftest manifest entries can be added to jstests.list michael@0: instead. Combining in-file comments with entries in this manifest file for michael@0: the same files is not supported (the one from the manifest file will be michael@0: used). Only the following two forms are supported: michael@0: include michael@0: script michael@0: The "include" indicates that should apply to all test michael@0: cases within a directory. A statement for a nested directory or script michael@0: overrides one for an enclosing directory. michael@0: michael@0: Running tests michael@0: ------------- michael@0: See michael@0: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Running_Automated_JavaScript_Tests