E58E Merge pull request #408 from nickva/run-test262-in-ci · bellard/quickjs@4af5b1e · GitHub
[go: up one dir, main page]

Skip to content

Commit 4af5b1e

Browse files
authored
Merge pull request #408 from nickva/run-test262-in-ci
Run test262 tests in CI
2 parents c3e5ae2 + fb14cc6 commit 4af5b1e

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

.github/workflows/ci.yml

Lines changed: 19 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
@@ -67,13 +71,18 @@ jobs:
6771
submodules: true
6872
- name: Install gcc-multilib
6973
run: |
74+
sudo apt update
7075
sudo apt install -y gcc-multilib
7176
- name: Build
7277
run: |
7378
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_M32=y
7479
- name: Run built-in tests
7580
run: |
7681
make CONFIG_M32=y test
82+
- name: Run test262
83+
run: |
84+
make test2-bootstrap
85+
make CONFIG_M32=y test2
7786
7887
linux-asan:
7988
runs-on: ubuntu-latest
@@ -138,6 +147,10 @@ jobs:
138147
- name: Run built-in tests
139148
run: |
140149
make test
150+
- name: Run test262
151+
run: |
152+
make test2-bootstrap
153+
make test2
141154
142155
macos-asan:
143156
runs-on: macos-latest
@@ -173,6 +186,8 @@ jobs:
173186
uses: vmactions/freebsd-vm@v1
174187
with:
175188
usesh: true
189+
copyback: false
190+
mem: 16384
176191
prepare: |
177192
pkg install -y gmake
178193
run: |
@@ -202,6 +217,10 @@ jobs:
202217
- name: Run built-in tests
203218
run: |
204219
make CONFIG_COSMO=y test
220+
- name: Run test262
221+
run: |
222+
make test2-bootstrap
223+
make CONFIG_COSMO=y test2
205224
206225
mingw-windows:
207226
name: MinGW Windows target

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ PREFIX?=/usr/local
5454
# use UB sanitizer
5555
#CONFIG_UBSAN=y
5656

57+
# TEST262 bootstrap config: commit id and shallow "since" parameter
58+
TEST262_COMMIT?=a5e69a1534de88d1eb29b76657d84c8541b72df7
59+
TEST262_SINCE?=2025-09-01
60+
5761
OBJDIR=.obj
5862

5963
ifdef CONFIG_ASAN
@@ -464,6 +468,15 @@ stats: qjs$(EXE)
464468
microbench: qjs$(EXE)
465469
$(WINE) ./qjs$(EXE) --std tests/microbench.js
466470

471+
ifeq ($(wildcard test262/features.txt),)
472+
test2-bootstrap:
473+
git clone --single-branch --shallow-since=$(TEST262_SINCE) https://github.com/tc39/test262.git
474+
(cd test262 && git checkout -q $(TEST262_COMMIT) && patch -p1 < ../tests/test262.patch && cd ..)
475+
else
476+
test2-bootstrap:
477+
(cd test262 && git fetch && git reset --hard $(TEST262_COMMIT) && patch -p1 < ../tests/test262.patch && cd ..)
478+
endif
479+
467480
ifeq ($(wildcard test262o/tests.txt),)
468481
test2o test2o-update:
469482
@echo test262o tests not installed

test262.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ for-of
116116
generators
117117
globalThis
118118
hashbang
119+
immutable-arraybuffer=skip
119120
import-attributes
120121
import-defer=skip
121122
import.meta

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)
0