Skip to content

Commit 95d25fa

Browse files
authored
Cleanup test_emscripten_api (emscripten-core#25605)
- Parameterize the test - Remove unnecessary skipping under sanitizers
1 parent cbadbba commit 95d25fa

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

test/test_core.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,18 +1855,15 @@ def test_set_align(self):
18551855

18561856
@no_modularize_instance('uses Module object directly')
18571857
@no_js_math('JS_MATH is not compatible with LINKABLE')
1858-
def test_emscripten_api(self):
1859-
self.set_setting('EXPORTED_FUNCTIONS', ['_main', '_save_me_aimee'])
1860-
self.do_core_test('test_emscripten_api.c')
1861-
1862-
# Sanitizers are not compatible with LINKABLE (dynamic linking).
1863-
# LLVM-libc overlay mode is not compatible with whole-archive (LINKABLE)
1864-
if not is_sanitizing(self.cflags) and not self.is_wasm64() and '-lllvmlibc' not in self.cflags:
1865-
# test EXPORT_ALL
1866-
self.clear_setting('EXPORTED_FUNCTIONS')
1867-
self.set_setting('EXPORT_ALL')
1868-
self.set_setting('LINKABLE')
1869-
self.do_core_test('test_emscripten_api.c', cflags=['-Wno-deprecated'])
1858+
@parameterized({
1859+
'': (['-sEXPORTED_FUNCTIONS=_main,_save_me_aimee'],),
1860+
# test EXPORT_ALL too
1861+
'export_all': (['-Wno-deprecated', '-sEXPORT_ALL', '-sLINKABLE'],),
1862+
})
1863+
def test_emscripten_api(self, args):
1864+
if '-sLINKABLE' in args and '-lllvmlibc' in self.cflags:
1865+
self.skipTest('LLVM-libc overlay mode is not compatible with whole-archive (LINKABLE)')
1866+
self.do_core_test('test_emscripten_api.c', cflags=args)
18701867

18711868
def test_emscripten_run_script_string_int(self):
18721869
src = r'''

0 commit comments

Comments
 (0)