oru / harness262
PHP based ECMAScript test262 harness
Requires
- php: ^8.2
- ext-intl: *
- fidry/cpu-core-counter: *
- symfony/yaml: ^6.2
- tc39/test262: ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: *
- infection/infection: *
- phpunit/phpunit: ^10.0
- psalm/plugin-phpunit: ^0.18.4
- symplify/easy-coding-standard: 11.2.4.72
- vimeo/psalm: ^5.6
README
This library aims to test ecma262 implementations.
Usage
The supplied testing harness can be used to execute the Test262 described in ECMA TR/104.
Run the following command to execute the complete test suite. Using the jit is advised.
$ harness ./vendor/tc39/test262/test
Command-line options
--debug
Runs the testsuite in sequence and allows for step-debugging using xdebug or similar solutions.
Caching and test timeouts are disabled for this setting.
--no-cache
, -n
Disables caching of test results.
--silent
, -s
Runs the testsuite without output.
--verbose
, -v
Runs the testsuite with extended output.
--concurrency <number of concurrent tests>
, -c <number of concurrent tests>
Sets the desired number of concurrent test cases to be run. The set value is clamped between one and the number of available logical cores on the host machine.
This option has no effect if the --debug
option is set.
--strict
Execute only tests that are implicitly strict.
--loose
Execute only tests that are implicitly non-strict.
--include <pattern>
Includes matching paths from the provided paths using the regular expression <pattern>
.
--exclude <pattern>
Excludes matching paths from the provided paths using the regular expression <pattern>
.
--stop-on-error
Stops the execution of the test suite after the first occurring error.
--stop-on-failure
Stops the execution of the test suite after the first occurring failure.
--stop-on-defect
Stops the execution of the test suite after the first occurring error or failure.
--only-strict
, --no-strict
, --module
, --async
and --raw
Providing one of these options will only execute test cases with the corresponding frontmatter flag. The onlyStrict
and noStrict
might be set implicitly (see Interpreting Test262 Tests - strict mode).
The options are mutually exclusive - providing two of those options will result in an empty test suite!
--timeout <seconds>
Changes the maximum execution time to <seconds>
. The default value is 10 seconds.
This option has no effect if the --debug
option is set.
Testing
$ phpunit $ infection $ psalm