Skip to content

Commit dd8a752

Browse files
authored
Run test_parseTools with WASM_BIGINT too. NFC (#16848)
1 parent c0a2496 commit dd8a752

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

tests/common.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,27 @@ def metafunc(self, with_minimal_runtime):
245245
return metafunc
246246

247247

248+
def also_with_wasm_bigint(f):
249+
assert callable(f)
250+
251+
def metafunc(self, with_bigint):
252+
if with_bigint:
253+
if not self.is_wasm():
254+
self.skipTest('wasm2js does not support WASM_BIGINT')
255+
if self.get_setting('WASM_BIGINT') is not None:
256+
self.skipTest('redundant in bigint test config')
257+
self.set_setting('WASM_BIGINT')
258+
self.require_node()
259+
self.node_args.append('--experimental-wasm-bigint')
260+
f(self)
261+
else:
262+
f(self)
263+
264+
metafunc._parameterize = {'': (False,),
265+
'bigint': (True,)}
266+
return metafunc
267+
268+
248269
def ensure_dir(dirname):
249270
dirname = Path(dirname)
250271
dirname.mkdir(parents=True, exist_ok=True)

tests/test_core.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from tools import shared, building, config, webassembly
2626
from common import RunnerCore, path_from_root, requires_native_clang, test_file, create_file
2727
from common import skip_if, needs_dylink, no_windows, no_mac, is_slow_test, parameterized
28-
from common import env_modify, with_env_modify, disabled, node_pthreads
28+
from common import env_modify, with_env_modify, disabled, node_pthreads, also_with_wasm_bigint
2929
from common import read_file, read_binary, require_v8, require_node
3030
from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER
3131
import clang_native
@@ -68,27 +68,6 @@ def decorated(self):
6868
return decorated
6969

7070

71-
def also_with_wasm_bigint(f):
72-
assert callable(f)
73-
74-
def metafunc(self, with_bigint):
75-
if with_bigint:
76-
if not self.is_wasm():
77-
self.skipTest('wasm2js does not support WASM_BIGINT')
78-
if self.get_setting('WASM_BIGINT') is not None:
79-
self.skipTest('redundant in bigint test config')
80-
self.set_setting('WASM_BIGINT')
81-
self.require_node()
82-
self.node_args.append('--experimental-wasm-bigint')
83-
f(self)
84-
else:
85-
f(self)
86-
87-
metafunc._parameterize = {'': (False,),
88-
'bigint': (True,)}
89-
return metafunc
90-
91-
9271
# without EMTEST_ALL_ENGINES set we only run tests in a single VM by
9372
# default. in some tests we know that cross-VM differences may happen and
9473
# so are worth testing, and they should be marked with this decorator

tests/test_other.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from common import env_modify, no_mac, no_windows, requires_native_clang, with_env_modify
3636
from common import create_file, parameterized, NON_ZERO, node_pthreads, TEST_ROOT, test_file
3737
from common import compiler_for, read_file, read_binary, EMBUILDER, require_v8, require_node
38-
from common import also_with_minimal_runtime
38+
from common import also_with_minimal_runtime, also_with_wasm_bigint
3939
from tools import shared, building, utils, deps_info, response_file
4040
import common
4141
import jsrun
@@ -11972,5 +11972,6 @@ def test_no_cfi(self):
1197211972
err = self.expect_fail([EMCC, '-fsanitize=cfi', '-flto', test_file('hello_world.c')])
1197311973
self.assertContained('emcc: error: emscripten does not currently support -fsanitize=cfi', err)
1197411974

11975+
@also_with_wasm_bigint
1197511976
def test_parseTools(self):
1197611977
self.do_other_test('test_parseTools.c', emcc_args=['--js-library', test_file('other/test_parseTools.js')])

0 commit comments

Comments
 (0)