Skip to content

Commit

Permalink
Enable wasm simd testing under recent versions of node. NFC (#18839)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Feb 24, 2023
1 parent 0933960 commit b3ffbcd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ jobs:
other.test_node_emscripten_num_logical_cores
core2.test_pthread_create
core2.test_i64_invoke_bigint
core2.test_sse2
core2.test_source_map
core2.test_exceptions_wasm
core2.test_pthread_unhandledrejection"
Expand Down Expand Up @@ -630,6 +631,7 @@ jobs:
EMTEST_SKIP_V8: "1"
EMTEST_SKIP_EH: "1"
EMTEST_SKIP_WASM64: "1"
EMTEST_SKIP_SIMD: "1"
steps:
- checkout
- run:
Expand Down Expand Up @@ -701,6 +703,7 @@ jobs:
EMTEST_SKIP_V8: "1"
EMTEST_SKIP_EH: "1"
EMTEST_SKIP_WASM64: "1"
EMTEST_SKIP_SIMD: "1"
EMCC_SKIP_SANITY_CHECK: "1"
steps:
- run:
Expand Down
17 changes: 17 additions & 0 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,23 @@ def require_wasm64(self):
else:
self.fail('either d8 or node >= 16 required to run wasm64 tests. Use EMTEST_SKIP_WASM64 to skip')

def require_simd(self):
if config.NODE_JS and config.NODE_JS in self.js_engines:
version = shared.check_node_version()
if version >= (16, 0, 0):
self.js_engines = [config.NODE_JS]
return

if config.V8_ENGINE and config.V8_ENGINE in self.js_engines:
self.emcc_args.append('-sENVIRONMENT=shell')
self.js_engines = [config.V8_ENGINE]
return

if 'EMTEST_SKIP_SIMD' in os.environ:
self.skipTest('test requires node >= 16 or d8 (and EMTEST_SKIP_SIMD is set)')
else:
self.fail('either d8 or node >= 16 required to run wasm64 tests. Use EMTEST_SKIP_SIMD to skip')

def require_wasm_eh(self):
if config.NODE_JS and config.NODE_JS in self.js_engines:
version = shared.check_node_version()
Expand Down
2 changes: 1 addition & 1 deletion test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
def wasm_simd(f):
@wraps(f)
def decorated(self, *args, **kwargs):
self.require_v8()
self.require_simd()
if self.get_setting('MEMORY64') == 2:
self.skipTest('https://github.com/WebAssembly/binaryen/issues/4638')
if not self.is_wasm():
Expand Down
2 changes: 2 additions & 0 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def shlex_quote(arg):
# Switch to shlex.join once we can depend on python 3.8:
# https://docs.python.org/3/library/shlex.html#shlex.join
def shlex_join(cmd):
if type(cmd) is str:
return cmd
return ' '.join(shlex_quote(x) for x in cmd)


Expand Down

0 comments on commit b3ffbcd

Please sign in to comment.