Home

Awesome

test262_harness_cpp

Source code and projects for a test harness that is able to run tests from the Official ECMAScript Conformance Test Suite over several C / C++ Javascript / ECMAScript runtimes available on the net.

Simply include the source code of the Javascript / ECMAScript engine of your choice into the project, plus the runtime that is associated with the engine, and you're ready to go.

Support for the following Javascript / ECMAScript engines is included:

Other C / C++ engines can be easily added, as long as they can be added to the project either as source code or libraries - examine the various runtime_***.h/.cpp sources to give you an idea of how the engine is expected to be called for the various tests.

The source code of the test harness is written in C++, without external dependencies on third-party libraries - except for the runtimes themselves. test262_harness_cpp runs as a command-line application, which expects the following arguments:

The following is an example of the output results file generated by test262_harness_cpp when run against Duktape:

[->PASS:NON_STRICT<-] /Users/heribertodelgado/Projects/test262-master/test/annexB/built-ins/escape/escape-above-astral.js
[->PASS:STRICT<-] /Users/heribertodelgado/Projects/test262-master/test/annexB/built-ins/escape/escape-above-astral.js
[->FAIL:NON_STRICT<-] /Users/heribertodelgado/Projects/test262-master/test/annexB/built-ins/escape/to-string-err-symbol.js
ReferenceError -  identifier 'Symbol' undefined
[->FAIL:STRICT<-] /Users/heribertodelgado/Projects/test262-master/test/annexB/built-ins/escape/to-string-err-symbol.js
ReferenceError -  identifier 'Symbol' undefined
[->PASS:NON_STRICT<-] /Users/heribertodelgado/Projects/test262-master/test/annexB/built-ins/escape/prop-desc.js
[->PASS:STRICT<-] /Users/heribertodelgado/Projects/test262-master/test/annexB/built-ins/escape/prop-desc.js

Compilation Instructions

Included with test262_harness_cpp are the following projects:

The application can also be compiled for other platforms, provided that you specify a proper implementation of directories.h / .cpp for your platform.

To create the command-line application using the supplied components:

MacOS:

Windows:

Linux (from Visual Studio):

Other platforms:

Licensing

The project is provided under the terms of the MIT License. Feel free to use this project and modify it to your leisure in order to run the tests of the Javascript / ECMAScript engine of your choice.