Skip to content

Commit

Permalink
Remove custom CMake setup in favor of using Ladybird's build
Browse files Browse the repository at this point in the history
Our support for building test262-runner in a standalone manner has gone
quite stale. Rather than keeping it up to date, just document using the
test262-runner from the Ladybird repository. And replace the setup.sh
script with a script that only clones/syncs the test262 repo.
  • Loading branch information
trflynn89 committed Sep 8, 2024
1 parent 8b54d73 commit c9a7fb7
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 106 deletions.
33 changes: 0 additions & 33 deletions CMakeLists.txt

This file was deleted.

42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
# LibJS test262

> Run the [Official ECMAScript Conformance Test Suite](https://github.com/tc39/test262) with [Ladybird](https://github.com/LadybirdWebBrowser/ladybird)'s [`LibJS`](https://github.com/LadybirdWebBrowser/ladybird/tree/master/Userland/Libraries/LibJS)
Run the [Official ECMAScript Conformance Test Suite](https://github.com/tc39/test262) with [Ladybird](https://github.com/LadybirdWebBrowser/ladybird)'s [`LibJS`](https://github.com/LadybirdWebBrowser/ladybird/tree/master/Userland/Libraries/LibJS)

## Installation

Install `git`, `cmake`, `ninja`, `gcc`/`clang` and `python3` (3.9+).
First, clone and build [the Ladybird project](https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/BuildInstructionsLadybird.md).
To run test262, only the `test262-runner` Ladybird target needs to be built. From the Ladybird checkout, run:

To install the script's dependencies, run:
```bash
./Meta/ladybird.sh build test262-runner
```

Then, in the libjs-test262 project, set up a virtual environment (optional) and install the script's dependencies:

```bash
virtualenv .venv
source .venv/bin/activate

```console
pip3 install -r requirements.txt
```

Dependencies are:

- `tqdm` for displaying a progress bar

## Usage

To clone test262, clone ladybird and build Lagom run:
Finally, clone or sync test262 itself:

```console
./setup.sh
```bash
./sync-test262.sh
```

The repositories will only be cloned if they don't exist yet locally.
If `LADYBIRD_SOURCE_DIR` is set, it will be used to compile the runner instead of cloning ladybird.
## Usage

Once that's done, run:
In the below command, `LADYBIRD_SOURCE_DIR` should point to the Ladybird checkout. The exact path to `test262-runner`
may vary depending on any extra options that were provided to `ladybird.sh` above.

```console
python3 main.py --libjs-test262-runner ./Build/bin/test262-runner --test262-root ./test262/
```bash
./main.py --libjs-test262-runner "${LADYBIRD_SOURCE_DIR}/Build/ladybird/bin/test262-runner" --test262-root ./test262
```

## Options
Expand Down Expand Up @@ -65,9 +71,7 @@ options:
--debug enable debug logging of the runner
```

## Current status
## Results

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).
Test results are updated for every commit to the Ladybird repository. They may be viewed here:
https://ladybirdbrowser.github.io/libjs-website/test262/
33 changes: 0 additions & 33 deletions cmake/FetchLagom.cmake

This file was deleted.

21 changes: 0 additions & 21 deletions setup.sh

This file was deleted.

17 changes: 17 additions & 0 deletions sync-test262.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
TEST262_SOURCE_DIR="${TEST262_SOURCE_DIR:-test262}"

log() {
echo -e "\033[0;34m[${1}]\033[0m ${2}"
}

if [[ -d "${TEST262_SOURCE_DIR}" ]]; then
log test262 "Updating test262 directory"

pushd "${TEST262_SOURCE_DIR}"
git pull
popd
else
log test262 "test262 directory not found, cloning repository"
git clone --depth 1 https://github.com/tc39/test262.git
fi

0 comments on commit c9a7fb7

Please sign in to comment.