Skip to content
dschaffe edited this page Jun 17, 2013 · 5 revisions

The test262 Brackets extension supports running and creating test262 test cases. The extension contains features simplifying the testcase development process. The extension supports running tests either against javascript shells or in a browser.

Background

The test262 test suite is the compliance test suite for JavaScript implementations to check for conformance to the EcmaScript 262 specification. The TC39 working group maintains and updates the JavaScript specification. Members of TC39 also maintain the test262 test suite project. More information on test262 can be found at http://tests262.ecmascript.org.

Running 262 (without using Brackets)

running from hosted site in browser

The test262 test suite can be run in a browser using the browser's javascript implementation. The hosted version of the test suite can run run by visiting http://test262.ecmascript.org by clicking on the Run tab and selecting any chapters.

running locally in browser

You may also run local changes to the html version of the test suite by downloading the test suite and building locally. Using mercurial or downloaded a tarball of the code visit http://hg.ecmascript.org/tests/tests262. Once the source code is setup locally run:

$ cd ./tools/packaging $ ./packager.py ES5.1 walking dir: /Users/dschaffe/workspace/test262/test/suite/.DS_Store ... Generating test cases for ES5 chapter: bestPractice Generating test cases for ES5 chapter: ch06 ... Deploying test harness files to 'TEST262_WEB_HARNESS_DIR'... Done. $ cd ../../website python -m SimpleHTTPServer # starts a web server open http://localhost:8000/default.html # open the index page in a browser

running against javascript shell

Download a javascript shell. For example you can fairly easily download and build v8 (see http://stackoverflow.com/questions/1802478/running-v8-javascript-engine-standalone). On OSX with homebrew you can also do: brew install v8 (same as downloading https://github.com/v8/v8/archive/3.15.11.tar.gz). Then you have v8 installed into /usr/local/bin/v8.

Once you have the v8 executable you can run the javascript shell version of the test suite by running:

./tools/packaging/test262.py --command=/usr/local/bin/v8 --full-summary === Summary ===

  • Ran 11746 tests
  • Passed 11594 tests (98.7%)
  • Failed 152 tests (1.3%)

More Information

Resources

Clone this wiki locally