Coder Social home page Coder Social logo

linusg / libjs-test262 Goto Github PK

View Code? Open in Web Editor NEW
28.0 8.0 15.0 116 KB

✅ Tools for running the test262 ECMAScript test suite with SerenityOS's JavaScript engine (LibJS)

Home Page: https://libjs.dev/test262

License: MIT License

Python 92.26% Shell 1.56% CMake 6.18%
javascript javascript-engine test262 test-runner serenityos libjs libjs-test262

libjs-test262's Introduction

LibJS test262

Run the Official ECMAScript Conformance Test Suite with SerenityOS's LibJS

Installation

Install git, cmake, ninja, gcc/clang and python3 (3.9+).

To install the script's dependencies, run:

pip3 install -r requirements.txt

Dependencies are:

  • tqdm for displaying a progress bar

Usage

To clone test262, clone SerenityOS, build Lagom, and build libjs-test262-runner, run:

./setup.sh

The repositories will only be cloned if they don't exist yet locally, so you can use this script for development of the test runner as well.

If SERENITY_SOURCE_DIR is set, it will be used instead. However, if the Lagom build directory already exists, the script will not touch your build in that case, so you'll need to build libLagom.a yourself.

Once that's done, run:

python3 main.py --libjs-test262-runner ./Build/_deps/lagom-build/bin/test262-runner --test262-root ./test262/

Options

usage: main.py [-h] [-j PATH] [-b] [-t PATH] [-p PATTERN] [-c CONCURRENCY] [--timeout TIMEOUT] [--memory-limit MEMORY_LIMIT] [--json] [--per-file PATH] [-s | -v] [-f] [--parse-only] [--ignore IGNORE] [--forward-stderr] [--summary]

Run the test262 ECMAScript test suite with SerenityOS's LibJS

optional arguments:
  -h, --help            show this help message and exit
  -j PATH, --libjs-test262-runner PATH
                        path to the 'libjs-test262-runner' binary
  -b, --use-bytecode    Use the bytecode interpreter to run the tests
  -t PATH, --test262-root PATH
                        path to the 'test262' directory
  -p PATTERN, --pattern PATTERN
                        glob pattern used for test file searching (defaults to test/**/*.js)
  -c CONCURRENCY, --concurrency CONCURRENCY
                        number of concurrent workers (defaults to number of CPU cores)
  --timeout TIMEOUT     timeout for each test run in seconds (defaults to 10)
  --memory-limit MEMORY_LIMIT
                        memory limit for each test run in megabytes (defaults to 512)
  --json                print the test results as JSON
  --per-file PATH       output per-file results to file
  -s, --silent          don't print any progress information
  -v, --verbose         print output of test runs
  -f, --fail-only       only show failed tests
  --parse-only          only parse the test files and fail/pass based on that
  --ignore IGNORE       ignore any tests matching the glob
  --forward-stderr      forward all stderr output to the stderr of the script
  --summary             only show the top level results
  --debug               enable debug logging of the runner

Current status

Most of the tests run to completion and yield correct results. Few of the test harness files do not parse yet or generate runtime errors, those are listed in the results under a separate category, as are tests that fail to parse their metadata, time out, or crash the engine (todo assertion failures, mostly).

libjs-test262's People

Contributors

adkaster avatar alimpfard avatar awesomekling avatar balaziks avatar bertaland avatar davidot avatar idanho avatar implicitfield avatar linusg avatar mattco98 avatar nooga avatar sin-ack avatar trflynn89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libjs-test262's Issues

timeout in docs says "seconds", but is actually msecs

According to CLI usage docs:

--timeout TIMEOUT     timeout for each test run in seconds (defaults to 10)

But when actually running tests, it seems that the timeout CLI argument is actually denominated in milliseconds. To repro:

  • Add code to a test that will cause it to pause for a long time (e.g. infinite loop or a debugger statement if running in a debugger)
  • Run tests using default timeout value
  • Now run tests again using --timeout 10

Expected: no difference; a paused or hung test is killed after 10 seconds in both cases
Actual: using --timeout 10, tests are killed almost instantaneously (I assume after 10ms)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.