@@ -7811,6 +7811,10 @@ def test_dash_s_bad_json_types(self):
7811
7811
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=[{"a":1}]'])
7812
7812
self.assertContained("list members in settings must be strings (not $<class 'dict'>)", err)
7813
7813
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
+
7814
7818
def test_zeroinit(self):
7815
7819
create_file('src.c', r'''
7816
7820
#include <stdio.h>
@@ -12017,21 +12021,23 @@ def test_default_to_cxx(self):
12017
12021
12018
12022
@parameterized({
12019
12023
'': ([],),
12020
- 'minimal': (['-sMINIMAL_RUNTIME', '-sSUPPORT_ERRNO' ],),
12024
+ 'minimal': (['-sMINIMAL_RUNTIME'],),
12021
12025
})
12022
12026
def test_support_errno(self, args):
12023
12027
self.emcc_args += args + ['-sEXPORTED_FUNCTIONS=_main,___errno_location', '-Wno-deprecated']
12024
12028
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')
12027
12031
12028
12032
# Run the same test again but with SUPPORT_ERRNO disabled. This time we don't expect errno
12029
12033
# 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')
12032
12035
12033
12036
# 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)
12035
12041
12036
12042
def test_assembly(self):
12037
12043
self.run_process([EMCC, '-c', test_file('other/test_asm.s'), '-o', 'foo.o'])
0 commit comments