From 582f3764bae0d40e302d390dc853579de11c75a8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 18 Jul 2019 14:27:05 -0700 Subject: [PATCH 1/2] Add a test for EM_JS with MAIN_MODULE (see #8993) [ci skip] --- tests/test_core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index 9c297186901ab..aba8058702a17 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1790,7 +1790,12 @@ def test_em_asm_parameter_pack(self): self.emcc_args += ['-std=c++11'] self.do_run_in_out_file_test('tests', 'core', 'test_em_asm_parameter_pack') - def test_em_js(self): + @parameterized({ + 'normal': ([],), + 'linked': (['-s', 'MAIN_MODULE=1'],), + }) + def test_em_js(self, args): + self.emcc_args += args self.do_run_in_out_file_test('tests', 'core', 'test_em_js') self.do_run_in_out_file_test('tests', 'core', 'test_em_js', force_c=True) From 74eb363fbd5bcb0303ad831e6ff46144a80a97ff Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Sat, 20 Jul 2019 06:19:36 -0700 Subject: [PATCH 2/2] fix test --- tests/test_core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index d240eb31ba80b..0ade71f23283d 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1792,9 +1792,11 @@ def test_em_asm_parameter_pack(self): @parameterized({ 'normal': ([],), - 'linked': (['-s', 'MAIN_MODULE=1'],), + 'linked': (['-s', 'MAIN_MODULE'],), }) def test_em_js(self, args): + if 'MAIN_MODULE' in args and self.get_setting('ALLOW_MEMORY_GROWTH') and not self.is_wasm(): + self.skipTest('main module not compatible with asm.js memory growth') self.emcc_args += args self.do_run_in_out_file_test('tests', 'core', 'test_em_js') self.do_run_in_out_file_test('tests', 'core', 'test_em_js', force_c=True)