@@ -2461,28 +2461,28 @@ def test_sdl_get_key_name(self):
2461
2461
2462
2462
@requires_network
2463
2463
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')
2467
2467
2468
2468
def test_sdl2_linkable(self):
2469
2469
# Ensure that SDL2 can be built with LINKABLE. This implies there are no undefined
2470
2470
# 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')
2473
2473
2474
2474
def test_sdl3_linkable(self):
2475
2475
# Ensure that SDL3 can be built with LINKABLE. This implies there are no undefined
2476
2476
# symbols in the library (because LINKABLE includes the entire library).
2477
2477
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')
2480
2480
2481
2481
@requires_network
2482
2482
def test_sdl2_gfx_linkable(self):
2483
2483
# 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')
2486
2486
2487
2487
@requires_network
2488
2488
def test_libpng(self):
@@ -2565,7 +2565,7 @@ def test_freetype(self):
2565
2565
@requires_network
2566
2566
def test_freetype_with_pthreads(self):
2567
2567
# 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')
2569
2569
2570
2570
@requires_network
2571
2571
def test_icu(self):
@@ -2575,18 +2575,18 @@ def test_icu(self):
2575
2575
@requires_network
2576
2576
def test_sdl2_ttf(self):
2577
2577
# 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')
2580
2580
2581
2581
@requires_network
2582
2582
def test_contrib_ports(self):
2583
2583
# Verify that contrib ports can be used (using the only contrib port available ATM, but can be replaced
2584
2584
# 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'])
2586
2586
2587
2587
@requires_network
2588
2588
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'])
2590
2590
2591
2591
@crossplatform
2592
2592
def test_external_ports_simple(self):
@@ -3534,7 +3534,7 @@ def test_embind_tsgen_ignore(self):
3534
3534
'-sSINGLE_FILE',
3535
3535
'-lembind', # Test duplicated link option.
3536
3536
]
3537
- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3537
+ self.emcc('other/embind_tsgen.cpp', extra_args)
3538
3538
self.assertFileContents(test_file('other/embind_tsgen_ignore_1.d.ts'), read_file('embind_tsgen.d.ts'))
3539
3539
# Test these args separately since they conflict with arguments in the first test.
3540
3540
extra_args = ['-sMODULARIZE',
@@ -3543,24 +3543,24 @@ def test_embind_tsgen_ignore(self):
3543
3543
'-sEXPORT_ES6=1',
3544
3544
'-sASSERTIONS=0',
3545
3545
'-sSTRICT=1']
3546
- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3546
+ self.emcc('other/embind_tsgen.cpp', extra_args)
3547
3547
self.assertFileContents(test_file('other/embind_tsgen_ignore_2.d.ts'), read_file('embind_tsgen.d.ts'))
3548
3548
# Also test this separately since it conflicts with other settings.
3549
3549
extra_args = ['-sWASM=0']
3550
- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3550
+ self.emcc('other/embind_tsgen.cpp', extra_args)
3551
3551
self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))
3552
3552
3553
3553
extra_args = ['-fsanitize=undefined',
3554
3554
'-gsource-map']
3555
- self.emcc(test_file( 'other/embind_tsgen.cpp') , extra_args)
3555
+ self.emcc('other/embind_tsgen.cpp', extra_args)
3556
3556
self.assertFileContents(test_file('other/embind_tsgen_ignore_3.d.ts'), read_file('embind_tsgen.d.ts'))
3557
3557
3558
3558
def test_embind_tsgen_worker_env(self):
3559
3559
self.cflags += ['-lembind', '--emit-tsd', 'embind_tsgen.d.ts']
3560
3560
# Passing -sWASM_WORKERS or -sPROXY_TO_WORKER requires the 'worker' environment
3561
3561
# at link time. Verify that TS binding generation still works in this case.
3562
3562
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)
3564
3564
self.assertFileContents(test_file('other/embind_tsgen.d.ts'), read_file('embind_tsgen.d.ts'))
3565
3565
3566
3566
def test_embind_tsgen_dylink(self):
@@ -6665,7 +6665,7 @@ def test_modularize_run_dependency(self):
6665
6665
''')
6666
6666
self.set_setting('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE', '$addRunDependency,$removeRunDependency')
6667
6667
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')
6669
6669
self.assertContained('add-dep\nremove-dep\nhello, world!\ngot module\n', self.run_js('run.mjs'))
6670
6670
6671
6671
def test_modularize_instantiation_error(self):
@@ -7929,7 +7929,7 @@ def run(opts):
7929
7929
if malloc:
7930
7930
args += ['-sMALLOC=%s' % malloc]
7931
7931
print(args)
7932
- self.emcc(test_file( 'hello_libcxx.cpp') , args=args)
7932
+ self.emcc('hello_libcxx.cpp', args=args)
7933
7933
sizes[name] = os.path.getsize('a.out.wasm')
7934
7934
print(sizes)
7935
7935
# dlmalloc is the default
@@ -14956,15 +14956,15 @@ def test_hello_world_argv(self):
14956
14956
self.do_runf('hello_world_argv.c', 'hello, world! (1)')
14957
14957
14958
14958
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'])
14960
14960
14961
14961
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'])
14963
14963
src = read_file('a.out.js')
14964
14964
self.assertContained('$Module$$', src)
14965
14965
14966
14966
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'])
14968
14968
14969
14969
@parameterized({
14970
14970
'no_std_exp': (['-DEMMALLOC_NO_STD_EXPORTS'],),
@@ -15592,7 +15592,7 @@ def test_unsupported_min_version_when_unsupported_env(self, env):
15592
15592
var MIN_SAFARI_VERSION = {{{ MIN_SAFARI_VERSION }}};
15593
15593
var MIN_FIREFOX_VERSION = {{{ MIN_FIREFOX_VERSION }}};
15594
15594
''')
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'])
15596
15596
src = read_file('a.out.js')
15597
15597
unsupported = 0x7FFFFFFF
15598
15598
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):
15609
15609
'wasm_workers': (['-sWASM_WORKERS'],),
15610
15610
})
15611
15611
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)
15613
15613
15614
15614
def test_libcxx_errors(self):
15615
15615
create_file('main.cpp', '''
@@ -15637,10 +15637,10 @@ def test_parsetools_make_removed_fs_assert(self):
15637
15637
15638
15638
removed_fs_assert_content = "IDBFS is no longer included by default"
15639
15639
15640
- self.emcc(test_file( 'hello_world.c') , output_filename='hello_world.js')
15640
+ self.emcc('hello_world.c', output_filename='hello_world.js')
15641
15641
self.assertContained(removed_fs_assert_content, read_file('hello_world.js'))
15642
15642
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')
15644
15644
self.assertNotContained(removed_fs_assert_content, read_file('hello_world.js'))
15645
15645
15646
15646
@crossplatform
0 commit comments