Skip to content

Commit

Permalink
Merge 72ced82 into be20b65
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Sep 2, 2020
2 parents be20b65 + 72ced82 commit e799ebc
Show file tree
Hide file tree
Showing 23 changed files with 1,213 additions and 151 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test262.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: EcmaScript official test suite (test262)
on:
push:
branches:
- master
tags: *
pull_request:
branches:
- master

jobs:
run_test262:
name: Run the test262 test suite
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

# Run and pload the results
- name: Checkout GitHub pages
if: github.event_name == 'push'
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
- run: mkdir -p gh-pages/test262
- run: echo $GITHUB_SHA
- run: echo $GITHUB_REF

- name: Run the test262 test suite
run: cargo run --release --bin tester -- -o gh-pages/test262

- name: Commit files
if: github.event_name == 'push'
run: |
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git pull
git commit -m "Add new test262 results" -a
cd ..
- name: Upload results
if: github.event_name == 'push'
uses: ad-m/[email protected]
with:
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ tests/js/test.js
*.string_data
*.string_index
*.events
chrome_profiler.json
chrome_profiler.json

# Logs
*.log
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "test262"]
path = test262
url = https://github.com/tc39/test262.git
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ There are some pre-defined tasks in [tasks.json](.vscode/tasks.json)
If you don't want to install everything on your machine, you can use the Dockerfile.
Start VSCode in container mode (you may need the docker container plugin) and use the Dockerfile.

## Testing

Boa provides its own test suite, and can also run the official ECMAScript test suite. To run the Boa test
suite, you can just run the normal `cargo test`, and to run the full ECMAScript test suite, you can run it
with this command:

```
cargo run --release --bin tester -- -v 2> error.log
```

Note that this requires the `test262` submodule to be checked out, so you will need to run the following first:

```
git submodule init && git submodule update
```

This will run the test suite in verbose mode (you can remove the `-- -v` part to run it in non-verbose mode),
and output nice colorings in the terminal. It will also output any panic information into the `error.log` file.

## Communication

We have a Discord server, feel free to ask questions here:
Expand Down
Loading

0 comments on commit e799ebc

Please sign in to comment.