Skip to content

Commit 07053fb

Browse files
authored
Add some minimal testing against jsc (javascriptcore) (#19626)
This should allow me to write a test for #18357 that can run in CI without requiring us to setup a full safari test environment.
1 parent b3e64ee commit 07053fb

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.circleci/config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,28 @@ jobs:
580580
title: "wasm64"
581581
test_targets: "wasm64 wasm64l.test_bigswitch"
582582
- upload-test-results
583+
test-jsc:
584+
executor: linux-python
585+
steps:
586+
- checkout
587+
- run:
588+
name: submodule update
589+
command: git submodule update --init
590+
- pip-install
591+
- build
592+
- run:
593+
name: install jsc
594+
command: |
595+
cd $HOME
596+
wget https://nodejs.org/dist/v18.12.0/node-v18.12.0-linux-x64.tar.xz
597+
tar -xf node-v18.12.0-linux-x64.tar.xz
598+
export PATH="`pwd`/node-v18.12.0-linux-x64/bin:${PATH}"
599+
npm install jsvu -g
600+
jsvu --os=default --engines=javascriptcore
601+
echo "JSC_ENGINE = [os.path.expanduser('~/.jsvu/bin/javascriptcore')]" >> ~/emsdk/.emscripten
602+
echo "JS_ENGINES = [JSC_ENGINE]" >> ~/emsdk/.emscripten
603+
- run-tests:
604+
test_targets: "core0.test_hello_world"
583605
test-node-compat:
584606
# We don't use `bionic` here since its tool old to run recent node versions:
585607
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
@@ -788,6 +810,7 @@ workflows:
788810
- test-sockets-chrome:
789811
requires:
790812
- build-linux
813+
- test-jsc
791814
- test-node-compat
792815
- test-windows
793816
- test-mac-arm64

test/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,11 @@ def setUp(self):
685685
self.required_engine = None
686686
self.wasm_engines = config.WASM_ENGINES.copy()
687687
self.use_all_engines = EMTEST_ALL_ENGINES
688+
if self.js_engines[0] != config.NODE_JS:
689+
# If our primary JS engine is something other than node then enable
690+
# shell support.
691+
default_envs = 'web,webview,worker,node'
692+
self.set_setting('ENVIRONMENT', default_envs + ',shell')
688693

689694
if EMTEST_DETECT_TEMPFILE_LEAKS:
690695
for root, dirnames, filenames in os.walk(self.temp_dir):
@@ -1981,7 +1986,7 @@ def btest(self, filename, expected=None, reference=None,
19811986
if not isinstance(expected, list):
19821987
expected = [expected]
19831988
if EMTEST_BROWSER == 'node':
1984-
self.js_engines = [config.NODE_JS]
1989+
self.require_node()
19851990
self.node_args += shared.node_pthread_flags()
19861991
output = self.run_js('test.js')
19871992
self.assertContained('RESULT: ' + expected[0], output)

0 commit comments

Comments
 (0)