Skip to content

Commit 9c0da0d

Browse files
committed
Run test262 tests in CI
Run test262 tests for Linux, macOS and Cosmopolitan Add a Makefile `test2-bootstrap` helper to clone and patch test262 tests at a particular commit. Running with the latest commit noticed a few tests were failing and added them to the errors list. Noticed a few flaky staging math tests (acosh and cbrt) and made a PR to test262 to fix those. The CI environment, especially for macOS, was a bit more unpredictable and was failing in atomics tests due to lower timeouts in the `atomicsHelper` so double the timeouts. The time didn't worsen too much. It still takes about 2-3 min.
1 parent bb986e5 commit 9c0da0d

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
- name: Run microbench
3737
run: |
3838
make microbench
39+
- name: Run test262
40+
run: |
41+
make test2-bootstrap
42+
make test2
3943
4044
linux-lto:
4145
name: Linux LTO
@@ -138,6 +142,10 @@ jobs:
138142
- name: Run built-in tests
139143
run: |
140144
make test
145+
- name: Run test262
146+
run: |
147+
make test2-bootstrap
148+
make test2
141149
142150
macos-asan:
143151
runs-on: macos-latest
@@ -202,6 +210,10 @@ jobs:
202210
- name: Run built-in tests
203211
run: |
204212
make CONFIG_COSMO=y test
213+
- name: Run test262
214+
run: |
215+
make test2-bootstrap
216+
make CONFIG_COSMO=y test2
205217
206218
mingw-windows:
207219
name: MinGW Windows target

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,12 @@ stats: qjs$(EXE)
464464
microbench: qjs$(EXE)
465465
$(WINE) ./qjs$(EXE) --std tests/microbench.js
466466

467+
TEST262_COMMIT?=4b5d36ab6ef2f59d0a8902cd383762547a3a74c4
468+
469+
test2-bootstrap:
470+
git clone --single-branch --shallow-since=2025-05-16 https://github.com/tc39/test262.git
471+
(cd test262 && git checkout -q $(TEST262_COMMIT) && patch -p1 < ../tests/test262.patch && cd ..)
472+
467473
ifeq ($(wildcard test262o/tests.txt),)
468474
test2o test2o-update:
469475
@echo test262o tests not installed

tests/test262.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ index 9828b15..4a5919d 100644
1414
+// small: 200,
1515
+// long: 1000,
1616
+// huge: 10000,
17-
+ yield: 20,
18-
+ small: 20,
19-
+ long: 100,
17+
+ yield: 40,
18+
+ small: 40,
19+
+ long: 200,
2020
+ huge: 1000,
2121
};
2222

0 commit comments

Comments
 (0)