From d26db4ba15ddde8f9e210e56201edf9d979c03bd Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 1 Nov 2024 17:45:46 -0700 Subject: [PATCH] Add an optimized variant of test_split_module This ensures that the test works on optimized binaries with export minification. --- test/test_other.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index c5a19fb2b2ad3..32baf47b75dd4 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12898,13 +12898,19 @@ def test_syscall_stubs(self): self.do_other_test('test_syscall_stubs.c') @parameterized({ - '': (False, False), - 'custom': (True, False), - 'jspi': (False, True), + '': (False, False, False), + 'custom': (True, False, False), + 'jspi': (False, True, False), + 'O3': (False, False, True) }) - def test_split_module(self, customLoader, jspi): + def test_split_module(self, customLoader, jspi, opt): self.set_setting('SPLIT_MODULE') - self.emcc_args += ['-g', '-Wno-experimental'] + self.emcc_args += ['-Wno-experimental'] + if opt: + # Test that it works in the presence of export minification + self.emcc_args += ['-O3'] + else: + self.emcc_args += ['-g'] self.emcc_args += ['--post-js', test_file('other/test_split_module.post.js')] if customLoader: self.emcc_args += ['--pre-js', test_file('other/test_load_split_module.pre.js')]