@@ -7811,6 +7811,10 @@ def test_dash_s_bad_json_types(self):
78117811 err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=[{"a":1}]'])
78127812 self.assertContained("list members in settings must be strings (not $<class 'dict'>)", err)
78137813
7814+ def test_dash_s_repeated(self):
7815+ err = self.expect_fail([EMCC, '-Werror', test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=foo', '-sEXPORTED_FUNCTIONS=bar'])
7816+ self.assertContained('emcc: error: -sEXPORTED_FUNCTIONS specified multiple times. Ignoring previous value (`foo`) [-Wunused-command-line-argument]', err)
7817+
78147818 def test_zeroinit(self):
78157819 create_file('src.c', r'''
78167820#include <stdio.h>
@@ -12017,21 +12021,23 @@ def test_default_to_cxx(self):
1201712021
1201812022 @parameterized({
1201912023 '': ([],),
12020- 'minimal': (['-sMINIMAL_RUNTIME', '-sSUPPORT_ERRNO' ],),
12024+ 'minimal': (['-sMINIMAL_RUNTIME'],),
1202112025 })
1202212026 def test_support_errno(self, args):
1202312027 self.emcc_args += args + ['-sEXPORTED_FUNCTIONS=_main,___errno_location', '-Wno-deprecated']
1202412028
12025- self.do_other_test('test_support_errno.c')
12026- size_default = os.path.getsize('test_support_errno.js')
12029+ self.do_other_test('test_support_errno.c', emcc_args=['-sSUPPORT_ERRNO'] )
12030+ size_enabled = os.path.getsize('test_support_errno.js')
1202712031
1202812032 # Run the same test again but with SUPPORT_ERRNO disabled. This time we don't expect errno
1202912033 # to be set after the failing syscall.
12030- self.emcc_args += ['-sSUPPORT_ERRNO=0']
12031- self.do_other_test('test_support_errno.c', out_suffix='_disabled')
12034+ self.do_other_test('test_support_errno.c', emcc_args=['-sSUPPORT_ERRNO=0'], out_suffix='_disabled')
1203212035
1203312036 # Verify the JS output was smaller
12034- self.assertLess(os.path.getsize('test_support_errno.js'), size_default)
12037+ size_disabled = os.path.getsize('test_support_errno.js')
12038+ print(size_enabled)
12039+ print(size_disabled)
12040+ self.assertLess(size_disabled, size_enabled)
1203512041
1203612042 def test_assembly(self):
1203712043 self.run_process([EMCC, '-c', test_file('other/test_asm.s'), '-o', 'foo.o'])
0 commit comments