Skip to content

Commit 750d701

Browse files
committed
Split test_emscripten_get_compiler_setting. NFC
Split the test so into two so we are testing one thing in each test.
1 parent a23b67a commit 750d701

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/test_core.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,14 +1907,13 @@ def test_emscripten_get_now(self):
19071907
self.do_runf('test_emscripten_get_now.c', 'Timer resolution is good')
19081908

19091909
def test_emscripten_get_compiler_setting(self):
1910-
src = test_file('core/emscripten_get_compiler_setting.c')
1911-
output = shared.replace_suffix(src, '.out')
1912-
# with assertions, a nice message is shown
1913-
self.set_setting('ASSERTIONS')
1914-
self.do_runf(src, 'You must build with -sRETAIN_COMPILER_SETTINGS', assert_returncode=NON_ZERO)
1915-
self.clear_setting('ASSERTIONS')
1916-
self.set_setting('RETAIN_COMPILER_SETTINGS')
1917-
self.do_runf(src, read_file(output).replace('waka', utils.EMSCRIPTEN_VERSION))
1910+
expected = read_file(test_file('core/emscripten_get_compiler_setting.out'))
1911+
expected = expected.replace('waka', utils.EMSCRIPTEN_VERSION)
1912+
self.do_runf('core/emscripten_get_compiler_setting.c', expected, cflags=['-sRETAIN_COMPILER_SETTINGS'])
1913+
1914+
def test_emscripten_get_compiler_setting_error(self):
1915+
# with assertions, a runtime error is shown if you try to use the API without RETAIN_COMPILER_SETTINGS
1916+
self.do_runf('core/emscripten_get_compiler_setting.c', 'You must build with -sRETAIN_COMPILER_SETTINGS', '-sASSERTIONS', assert_returncode=NON_ZERO)
19181917

19191918
@no_esm_integration('WASM_ESM_INTEGRATION is not compatible with ASYNCIFY=1')
19201919
def test_emscripten_has_asyncify(self):

0 commit comments

Comments
 (0)