Skip to content

Commit 7b4831b

Browse files
committed
Add test for standalone binary imports.
1 parent f86eeb4 commit 7b4831b

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
@@ -15167,6 +15167,15 @@ def test_standalone_settings(self):
1516715167
err = self.expect_fail(base_cmd + ['-sMEMORY_GROWTH_LINEAR_STEP=1mb'])
1516815168
self.assertContained('error: MEMORY_GROWTH_LINEAR_STEP is not compatible with STANDALONE_WASM', err)
1516915169

15170+
def test_standalone_imports(self):
15171+
# Ensure standalone binary will not have __throw_exception_with_stack_trace
15172+
# debug helper dependency, caused by exception-related code.
15173+
src_path = test_file('core/test_exceptions.cpp')
15174+
self.run_process([EMXX, '-O0', '-fwasm-exceptions', '-sSTANDALONE_WASM', src_path])
15175+
imports = self.parse_wasm('a.out.wasm')[0]
15176+
for name in imports:
15177+
self.assertTrue(name.startswith('wasi_'), 'Unexpected import %s' % name)
15178+
1517015179
@is_slow_test
1517115180
def test_googletest(self):
1517215181
# TODO(sbc): Should we package gtest as an emscripten "port"? I guess we should if

0 commit comments

Comments
 (0)