@@ -2461,28 +2461,28 @@ def test_sdl_get_key_name(self):
24612461
24622462 @requires_network
24632463 def test_sdl2_mixer_wav(self):
2464- self.emcc(test_file( 'browser/test_sdl2_mixer_wav.c') , ['-sUSE_SDL_MIXER=2'], output_filename='a.out.js')
2465- self.emcc(test_file( 'browser/test_sdl2_mixer_wav.c') , ['--use-port=sdl2_mixer'], output_filename='a.out.js')
2466- self.emcc(test_file( 'browser/test_sdl2_mixer_wav.c') , ['--use-port=sdl2_mixer:formats=ogg'], output_filename='a.out.js')
2464+ self.emcc('browser/test_sdl2_mixer_wav.c', ['-sUSE_SDL_MIXER=2'], output_filename='a.out.js')
2465+ self.emcc('browser/test_sdl2_mixer_wav.c', ['--use-port=sdl2_mixer'], output_filename='a.out.js')
2466+ self.emcc('browser/test_sdl2_mixer_wav.c', ['--use-port=sdl2_mixer:formats=ogg'], output_filename='a.out.js')
24672467
24682468 def test_sdl2_linkable(self):
24692469 # Ensure that SDL2 can be built with LINKABLE. This implies there are no undefined
24702470 # symbols in the library (because LINKABLE includes the entire library).
2471- self.emcc(test_file( 'browser/test_sdl2_misc.c') , ['-sLINKABLE', '-Wno-deprecated', '-sUSE_SDL=2'], output_filename='a.out.js')
2472- self.emcc(test_file( 'browser/test_sdl2_misc.c') , ['-sLINKABLE', '-Wno-deprecated', '--use-port=sdl2'], output_filename='a.out.js')
2471+ self.emcc('browser/test_sdl2_misc.c', ['-sLINKABLE', '-Wno-deprecated', '-sUSE_SDL=2'], output_filename='a.out.js')
2472+ self.emcc('browser/test_sdl2_misc.c', ['-sLINKABLE', '-Wno-deprecated', '--use-port=sdl2'], output_filename='a.out.js')
24732473
24742474 def test_sdl3_linkable(self):
24752475 # Ensure that SDL3 can be built with LINKABLE. This implies there are no undefined
24762476 # symbols in the library (because LINKABLE includes the entire library).
24772477 self.cflags.append('-Wno-experimental')
2478- self.emcc(test_file( 'browser/test_sdl3_misc.c') , ['-sLINKABLE', '-Wno-deprecated', '-sUSE_SDL=3'], output_filename='a.out.js')
2479- self.emcc(test_file( 'browser/test_sdl3_misc.c') , ['-sLINKABLE', '-Wno-deprecated', '--use-port=sdl3'], output_filename='a.out.js')
2478+ self.emcc('browser/test_sdl3_misc.c', ['-sLINKABLE', '-Wno-deprecated', '-sUSE_SDL=3'], output_filename='a.out.js')
2479+ self.emcc('browser/test_sdl3_misc.c', ['-sLINKABLE', '-Wno-deprecated', '--use-port=sdl3'], output_filename='a.out.js')
24802480
24812481 @requires_network
24822482 def test_sdl2_gfx_linkable(self):
24832483 # Same as above but for sdl2_gfx library
2484- self.emcc(test_file( 'browser/test_sdl2_misc.c') , ['-Wl,-fatal-warnings', '-sLINKABLE', '-Wno-deprecated', '-sUSE_SDL_GFX=2'], output_filename='a.out.js')
2485- self.emcc(test_file( 'browser/test_sdl2_misc.c') , ['-Wl,-fatal-warnings', '-sLINKABLE', '-Wno-deprecated', '--use-port=sdl2_gfx'], output_filename='a.out.js')
2484+ self.emcc('browser/test_sdl2_misc.c', ['-Wl,-fatal-warnings', '-sLINKABLE', '-Wno-deprecated', '-sUSE_SDL_GFX=2'], output_filename='a.out.js')
2485+ self.emcc('browser/test_sdl2_misc.c', ['-Wl,-fatal-warnings', '-sLINKABLE', '-Wno-deprecated', '--use-port=sdl2_gfx'], output_filename='a.out.js')
24862486
24872487 @requires_network
24882488 def test_libpng(self):
@@ -2565,7 +2565,7 @@ def test_freetype(self):
25652565 @requires_network
25662566 def test_freetype_with_pthreads(self):
25672567 # Verify that freetype supports compilation requiring pthreads
2568- self.emcc(test_file( 'test_freetype.c') , ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js')
2568+ self.emcc('test_freetype.c', ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js')
25692569
25702570 @requires_network
25712571 def test_icu(self):
@@ -2575,18 +2575,18 @@ def test_icu(self):
25752575 @requires_network
25762576 def test_sdl2_ttf(self):
25772577 # This is a compile-only to test to verify that sdl2-ttf (and freetype and harfbuzz) are buildable.
2578- self.emcc(test_file( 'browser/test_sdl2_ttf.c') , args=['-sUSE_SDL=2', '-sUSE_SDL_TTF=2'], output_filename='a.out.js')
2579- self.emcc(test_file( 'browser/test_sdl2_ttf.c') , args=['--use-port=sdl2', '--use-port=sdl2_ttf'], output_filename='a.out.js')
2578+ self.emcc('browser/test_sdl2_ttf.c', args=['-sUSE_SDL=2', '-sUSE_SDL_TTF=2'], output_filename='a.out.js')
2579+ self.emcc('browser/test_sdl2_ttf.c', args=['--use-port=sdl2', '--use-port=sdl2_ttf'], output_filename='a.out.js')
25802580
25812581 @requires_network
25822582 def test_contrib_ports(self):
25832583 # Verify that contrib ports can be used (using the only contrib port available ATM, but can be replaced
25842584 # with a different contrib port when there is another one
2585- self.emcc(test_file( 'other/test_contrib_ports.cpp') , ['--use-port=contrib.glfw3'])
2585+ self.emcc('other/test_contrib_ports.cpp', ['--use-port=contrib.glfw3'])
25862586
25872587 @requires_network
25882588 def test_remote_ports(self):
2589- self.emcc(test_file( 'hello_world.c') , ['--use-port=emdawnwebgpu'])
2589+ self.emcc('hello_world.c', ['--use-port=emdawnwebgpu'])
25902590
25912591 @crossplatform
25922592 def test_external_ports_simple(self):
@@ -3534,7 +3534,7 @@ def test_embind_tsgen_ignore(self):
35343534 '-sSINGLE_FILE',
35353535 '-lembind', # Test duplicated link option.
35363536 ]
3537- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3537+ self.emcc('other/embind_tsgen.cpp', extra_args)
35383538 self.assertFileContents(test_file('other/embind_tsgen_ignore_1.d.ts'), read_file('embind_tsgen.d.ts'))
35393539 # Test these args separately since they conflict with arguments in the first test.
35403540 extra_args = ['-sMODULARIZE',
@@ -3543,24 +3543,24 @@ def test_embind_tsgen_ignore(self):
35433543 '-sEXPORT_ES6=1',
35443544 '-sASSERTIONS=0',
35453545 '-sSTRICT=1']
3546- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3546+ self.emcc('other/embind_tsgen.cpp', extra_args)
35473547 self.assertFileContents(test_file('other/embind_tsgen_ignore_2.d.ts'), read_file('embind_tsgen.d.ts'))
35483548 # Also test this separately since it conflicts with other settings.
35493549 extra_args = ['-sWASM=0']
3550- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3550+ self.emcc('other/embind_tsgen.cpp', extra_args)
35513551 self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))
35523552
35533553 extra_args = ['-fsanitize=undefined',
35543554 '-gsource-map']
3555- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3555+ self.emcc('other/embind_tsgen.cpp', extra_args)
35563556 self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))
35573557
35583558 def test_embind_tsgen_worker_env(self):
35593559 self.cflags += ['-lembind', '--emit-tsd', 'embind_tsgen.d.ts']
35603560 # Passing -sWASM_WORKERS or -sPROXY_TO_WORKER requires the 'worker' environment
35613561 # at link time. Verify that TS binding generation still works in this case.
35623562 for flags in (['-sWASM_WORKERS'], ['-sPROXY_TO_WORKER', '-Wno-deprecated']):
3563- self.emcc(test_file( 'other/embind_tsgen.cpp') , flags)
3563+ self.emcc('other/embind_tsgen.cpp', flags)
35643564 self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
35653565
35663566 def test_embind_tsgen_dylink(self):
@@ -6665,7 +6665,7 @@ def test_modularize_run_dependency(self):
66656665 ''')
66666666 self.set_setting('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE', '$addRunDependency,$removeRunDependency')
66676667 self.cflags += ['-sEXPORT_ES6', '-sMODULARIZE', '-sWASM_ASYNC_COMPILATION=0', '--pre-js=pre.js']
6668- self.emcc(test_file( 'hello_world.c') , output_filename='hello_world.mjs')
6668+ self.emcc('hello_world.c', output_filename='hello_world.mjs')
66696669 self.assertContained('add-dep\nremove-dep\nhello, world!\ngot module\n', self.run_js('run.mjs'))
66706670
66716671 def test_modularize_instantiation_error(self):
@@ -7929,7 +7929,7 @@ def run(opts):
79297929 if malloc:
79307930 args += ['-sMALLOC=%s' % malloc]
79317931 print(args)
7932- self.emcc(test_file( 'hello_libcxx.cpp') , args=args)
7932+ self.emcc('hello_libcxx.cpp', args=args)
79337933 sizes[name] = os.path.getsize('a.out.wasm')
79347934 print(sizes)
79357935 # dlmalloc is the default
@@ -14956,15 +14956,15 @@ def test_hello_world_argv(self):
1495614956 self.do_runf('hello_world_argv.c', 'hello, world! (1)')
1495714957
1495814958 def test_strict_closure(self):
14959- self.emcc(test_file( 'hello_world.c') , ['-sSTRICT', '--closure=1'])
14959+ self.emcc('hello_world.c', ['-sSTRICT', '--closure=1'])
1496014960
1496114961 def test_closure_debug(self):
14962- self.emcc(test_file( 'hello_world.c') , ['-sSTRICT', '--closure=1', '-g'])
14962+ self.emcc('hello_world.c', ['-sSTRICT', '--closure=1', '-g'])
1496314963 src = read_file('a.out.js')
1496414964 self.assertContained('$Module$$', src)
1496514965
1496614966 def test_arguments_global(self):
14967- self.emcc(test_file( 'hello_world_argv.c') , ['-sENVIRONMENT=web', '-sSTRICT', '--closure=1', '-O2'])
14967+ self.emcc('hello_world_argv.c', ['-sENVIRONMENT=web', '-sSTRICT', '--closure=1', '-O2'])
1496814968
1496914969 @parameterized({
1497014970 'no_std_exp': (['-DEMMALLOC_NO_STD_EXPORTS'],),
@@ -15592,7 +15592,7 @@ def test_unsupported_min_version_when_unsupported_env(self, env):
1559215592 var MIN_SAFARI_VERSION = {{{ MIN_SAFARI_VERSION }}};
1559315593 var MIN_FIREFOX_VERSION = {{{ MIN_FIREFOX_VERSION }}};
1559415594 ''')
15595- self.emcc(test_file( 'hello_world.c') , [f'-sENVIRONMENT={env}', '--pre-js=pre.js'])
15595+ self.emcc('hello_world.c', [f'-sENVIRONMENT={env}', '--pre-js=pre.js'])
1559615596 src = read_file('a.out.js')
1559715597 unsupported = 0x7FFFFFFF
1559815598 self.assertContainedIf(f'var MIN_NODE_VERSION = {unsupported};', src, env == 'web')
@@ -15609,7 +15609,7 @@ def test_unsupported_min_version_when_unsupported_env(self, env):
1560915609 'wasm_workers': (['-sWASM_WORKERS'],),
1561015610 })
1561115611 def test_automatic_env_worker(self, env, args):
15612- self.emcc(test_file( 'hello_world.c') , [f'-sENVIRONMENT={env}'] + args)
15612+ self.emcc('hello_world.c', [f'-sENVIRONMENT={env}'] + args)
1561315613
1561415614 def test_libcxx_errors(self):
1561515615 create_file('main.cpp', '''
@@ -15637,10 +15637,10 @@ def test_parsetools_make_removed_fs_assert(self):
1563715637
1563815638 removed_fs_assert_content = "IDBFS is no longer included by default"
1563915639
15640- self.emcc(test_file( 'hello_world.c') , output_filename='hello_world.js')
15640+ self.emcc('hello_world.c', output_filename='hello_world.js')
1564115641 self.assertContained(removed_fs_assert_content, read_file('hello_world.js'))
1564215642
15643- self.emcc(test_file( 'hello_world.c') , ['-lidbfs.js'], output_filename='hello_world.js')
15643+ self.emcc('hello_world.c', ['-lidbfs.js'], output_filename='hello_world.js')
1564415644 self.assertNotContained(removed_fs_assert_content, read_file('hello_world.js'))
1564515645
1564615646 @crossplatform
0 commit comments