Skip to content

Run test262 tests in CI #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
- name: Run microbench
run: |
make microbench
- name: Run test262
run: |
make test2-bootstrap
make test2

linux-lto:
name: Linux LTO
Expand Down Expand Up @@ -138,6 +142,10 @@ jobs:
- name: Run built-in tests
run: |
make test
- name: Run test262
run: |
make test2-bootstrap
make test2

macos-asan:
runs-on: macos-latest
Expand Down Expand Up @@ -172,7 +180,12 @@ jobs:
- name: Build + test
uses: vmactions/freebsd-vm@v1
with:
# This VM has a tendency to get stuck in the "VM is booting" cycle
# for quite a while, so set a shorter timeout
timeout-minutes: 15
usesh: true
copyback: false
mem: 16384
prepare: |
pkg install -y gmake
run: |
Expand Down Expand Up @@ -202,6 +215,10 @@ jobs:
- name: Run built-in tests
run: |
make CONFIG_COSMO=y test
- name: Run test262
run: |
make test2-bootstrap
make CONFIG_COSMO=y test2

mingw-windows:
name: MinGW Windows target
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ PREFIX?=/usr/local
# use UB sanitizer
#CONFIG_UBSAN=y

# TEST262 bootstrap config: commit id and shallow "since" parameter
TEST262_COMMIT?=a073f479f80b336256b7fc4e04700c827293e2fe
TEST262_SINCE?=2025-06-09

OBJDIR=.obj

ifdef CONFIG_ASAN
Expand Down Expand Up @@ -464,6 +468,15 @@ stats: qjs$(EXE)
microbench: qjs$(EXE)
$(WINE) ./qjs$(EXE) --std tests/microbench.js

ifeq ($(wildcard test262/features.txt),)
test2-bootstrap:
git clone --single-branch --shallow-since=$(TEST262_SINCE) https://github.com/tc39/test262.git
(cd test262 && git checkout -q $(TEST262_COMMIT) && patch -p1 < ../tests/test262.patch && cd ..)
else
test2-bootstrap:
(cd test262 && git fetch && git reset --hard $(TEST262_COMMIT) && patch -p1 < ../tests/test262.patch && cd ..)
endif

ifeq ($(wildcard test262o/tests.txt),)
test2o test2o-update:
@echo test262o tests not installed
Expand Down
6 changes: 3 additions & 3 deletions tests/test262.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ index 9828b15..4a5919d 100644
+// small: 200,
+// long: 1000,
+// huge: 10000,
+ yield: 20,
+ small: 20,
+ long: 100,
+ yield: 40,
+ small: 40,
+ long: 200,
+ huge: 1000,
};

Expand Down
Loading