Skip to content

Commit df02694

Browse files
committed
[test] Parameterize test_function_exports_are_small. NFC
1 parent 1d1133a commit df02694

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

test/test_other.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10703,10 +10703,19 @@ def test_emscripten_license(self, expect_license, args):
1070310703
# unminified exported name exactly once. (need to contain the export name once for unminified
1070410704
# access from calling code, and should not have the unminified name exist more than once, that
1070510705
# would be wasteful for size)
10706-
def test_function_exports_are_small(self):
10706+
@parameterized({
10707+
'': ([],),
10708+
'closure': (['--closure=1'],),
10709+
})
10710+
@parameterized({
10711+
'O2': (['-O2'],),
10712+
'O2': (['-O2'],),
10713+
'Os': (['-Os'],),
10714+
})
10715+
def test_function_exports_are_small(self, opt, closure):
1070710716
def test(args, closure, opt):
10717+
print(args)
1070810718
extra_args = args + opt + closure
10709-
print(extra_args)
1071010719
args = [EMCC, test_file('long_function_name_in_export.c'), '-o', 'a.html', '-sENVIRONMENT=web', '-sDECLARE_ASM_MODULE_EXPORTS=0', '-Werror'] + extra_args
1071110720
self.run_process(args)
1071210721

@@ -10720,10 +10729,8 @@ def test(args, closure, opt):
1072010729
num_times_export_is_referenced = output.count('thisIsAFunctionExportedFromAsmJsOrWasmWithVeryLongFunction')
1072110730
self.assertEqual(num_times_export_is_referenced, 1)
1072210731

10723-
for closure in [[], ['--closure=1']]:
10724-
for opt in [['-O2'], ['-O3'], ['-Os']]:
10725-
test(['-sWASM=0', '-Wno-closure'], closure, opt)
10726-
test(['-sWASM_ASYNC_COMPILATION=0'], closure, opt)
10732+
test(['-sWASM=0', '-Wno-closure'], closure, opt)
10733+
test(['-sWASM_ASYNC_COMPILATION=0'], closure, opt)
1072710734

1072810735
@parameterized({
1072910736
'hello_world_wasm': ('hello_world', False, True),

0 commit comments

Comments
 (0)