10.0.0 • Published 3 years ago

test262-harness v10.0.0

Weekly downloads
948
License
BSD-3-Clause
Repository
github
Last release
3 years ago

Test262-Harness

Travis Build Status

Getting Started

For Development of Test262-Harness

For development of Test262-harness, test authoring & execution:

git clone https://github.com/tc39/test262.git --depth 1
cd test262

For Test Authoring & Test Execution:

For test authoring & execution:

npm install -g test262-harness

Run test262-harness --help for details on the various configuration options.

Examples

Running tests in hypothetical JavaScript engine "X":

cd test262;
test262-harness --host-type=X --host-path=`which X` test/**/*.js

Options

Option NameDescriptionRequiredDefault
-h, --helpShow help & examplesn/an/a
-v, --versionPrint the current version of test262-harnessn/an/a
--host-typeType of host to run tests in. See eshost's supported hosts for available options.Nonode
--host-pathPath to the host executable.Yes, if host-type is specifiedprocess.execPath
--host-argsAny additional arguments to pass to the host when invoking it (eg. --harmony, --es6all, etc).Non/a
-t, --threadsRun this many tests in parallel. Note that the browser runners don't work great with t > 1.No1
-r, --reporterFormat of data written to standard output. Currently either json or simple.Nosimple
--features (deprecated)Comma-separated list of features to filter for. Example: --features="BigInt,Atomics".Non/a
--features-includeComma-separated list of features to filter for inclusion. Example: --features-include="BigInt,Atomics" would run only tests that include the features BigInt and AtomicsNon/a
--features-excludeComma-separated list of features to filter for exclusion. Example: --features-exclude="BigInt,Atomics" would run only tests that do not include the features BigInt and Atomics. NOTE exclusions are resolved after inclusions.Non/a
--reporter-keysComma-separated list of keys to include in output of json reporter.Non/a
--test262-dirRoot test262 directory and is used to locate the includes directory.NoRelative to test files
--includes-dirIncludes directory.NoInferred from test262-dir or else detected by walking upward from the first test found.
--tempDirDirectory that eshost will create its temp files in (does not affect location of files created by --save-compiled-tests and --save-only-failedNoOS Temp Dir
--preludePath to a file to include before every test (useful for testing polyfills for example); supports multiple --prelude parametersNon/a
--timeoutSet a custom test timeout in millisecondsNo10000
--transformerPath to module which exports a code transformer functionNon/a
--preprocessorPath to module which exports a map function that operates on each Test262Test object before it executed.Non/a
--accept-versionExecute tests from a version of Test262 that differs from the versions supported by this utility. This may cause the utility to report invalid test results.NoInferred from test262Dir/package.json
--save-compiled-testsWrite the compiled version of path/to/test.js as path/to/test.js.<host-type>.<default\|strict>.<pass\|fail> so that it can be easily re-run under that host. Run test262-harness --help for examples.Non/a
--save-only-failedOnly save the compiled version of the test if it failed, to help easily repro failed tests (implies --save-compiled-tests).Non/a
--error-for-failuresReturn a non-zero exit code if one or more tests fail.Non/a

Preprocessor

The --preprocessor feature allows a module that exports a map function that operates on each Test262Test object (ie. the object emitted by Test262-Stream) before their execution.

test.result = Result Object

In some cases, a preprocessor may want to signal to Test262-Harness that a certain result has already been reached, and that it must not further evaluate the test. To create this signal, the preprocessor creates a result property on the Test262Test object, which will indicate to Test262-Harness that it must not evaluate the test, but instead return the value of the result property as though the test had been executed. For example, a preprocessor may attempt to transpile the value of test.contents—which may fail! In the case of failure, the preprocessor can create a result property whose value is a Result Object. This will skip the code evaluation and report the given result object.

module.exports = function(test) {
  try {
    test.contents = babel.transform(test.contents, options).code;
  } catch (error) {
    test.result = {
      stderr: `${error.name}: ${error.message}\n`,
      stdout: '',
      error
    };
  }

  return test;
};
10.0.0

3 years ago

9.1.0

3 years ago

9.2.0

3 years ago

9.0.0

4 years ago

7.7.0

4 years ago

8.0.0

4 years ago

7.6.0

4 years ago

7.5.2

5 years ago

7.5.1

5 years ago

7.5.0

5 years ago

7.4.1

5 years ago

7.4.0

5 years ago

7.3.1

5 years ago

7.3.0

5 years ago

7.2.0

5 years ago

7.1.0

5 years ago

7.0.0

5 years ago

6.7.0

5 years ago

6.6.0

5 years ago

6.5.0

6 years ago

6.4.0

6 years ago

6.3.3

6 years ago

6.3.2

6 years ago

6.3.1

6 years ago

6.3.0

6 years ago

6.2.0

6 years ago

6.1.0

6 years ago

6.0.0

6 years ago

5.1.0

6 years ago

5.0.0

7 years ago

4.7.0

7 years ago

4.6.0

7 years ago

4.5.0

7 years ago

4.4.0

7 years ago

4.3.0

7 years ago

4.2.0

7 years ago

4.1.0

7 years ago

4.0.0

7 years ago

3.7.0

7 years ago

3.6.0

7 years ago

3.5.0

7 years ago

3.4.0

7 years ago

3.3.0

7 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.6.0

8 years ago

2.5.0

8 years ago

2.4.1

8 years ago

2.4.0

9 years ago

2.3.1

9 years ago

2.3.0

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.1

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.5.6

10 years ago

1.5.5

10 years ago

1.5.4

10 years ago

1.5.3

10 years ago

1.5.2

10 years ago

1.5.1

10 years ago

1.5.0

10 years ago

1.4.0

10 years ago

1.3.1

11 years ago

1.3.0

11 years ago

1.2.0

11 years ago

1.1.5

11 years ago

1.1.4

11 years ago

1.1.3

11 years ago

1.1.2

11 years ago

1.1.1

11 years ago

1.1.0

11 years ago