Skip to content

Commit c9a79df

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 5ade6f5 commit c9a79df

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/test_core.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,15 +1910,13 @@ def test_emscripten_get_now(self):
19101910
def test_emscripten_get_compiler_setting(self):
19111911
if not self.is_optimizing() and ('-flto' in self.cflags or '-flto=thin' in self.cflags):
19121912
self.skipTest('https://github.com/emscripten-core/emscripten/issues/25015')
1913+
expected = read_file(test_file('core/emscripten_get_compiler_setting.out'))
1914+
expected = expected.replace('waka', utils.EMSCRIPTEN_VERSION)
1915+
self.do_runf('core/emscripten_get_compiler_setting.c', expected, cflags=['-sRETAIN_COMPILER_SETTINGS'])
19131916

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

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

0 commit comments

Comments
 (0)