Skip to content

Commit 38c31db

Browse files
committed
Add test for standalone binary imports.
1 parent e665bb4 commit 38c31db

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test_other.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15182,6 +15182,15 @@ def test_standalone_settings(self):
1518215182
err = self.expect_fail(base_cmd + ['-sMEMORY_GROWTH_LINEAR_STEP=1mb'])
1518315183
self.assertContained('error: MEMORY_GROWTH_LINEAR_STEP is not compatible with STANDALONE_WASM', err)
1518415184

15185+
def test_standalone_imports(self):
15186+
# Ensure standalone binary will not have __throw_exception_with_stack_trace
15187+
# debug helper dependency, caused by exception-related code.
15188+
src_path = test_file('core/test_exceptions.cpp')
15189+
self.run_process([EMXX, '-O0', '-fwasm-exceptions', '-sSTANDALONE_WASM', src_path])
15190+
imports = self.parse_wasm('a.out.wasm')[0]
15191+
for name in imports:
15192+
self.assertTrue(name.startswith('wasi_'), 'Unexpected import %s' % name)
15193+
1518515194
@is_slow_test
1518615195
def test_googletest(self):
1518715196
# TODO(sbc): Should we package gtest as an emscripten "port"? I guess we should if

0 commit comments

Comments
 (0)