@@ -1375,12 +1375,15 @@ def test_write_file_in_environment_web(self):
1375
1375
def test_fflush (self ):
1376
1376
self .btest ('test_fflush.cpp' , '0' , args = ['-sEXIT_RUNTIME' , '--shell-file' , test_file ('test_fflush.html' )], reporting = Reporting .NONE )
1377
1377
1378
- def test_fs_idbfs_sync (self ):
1378
+ @parameterized ({
1379
+ '' : ([],),
1380
+ 'extra' : (['-DEXTRA_WORK' ],),
1381
+ })
1382
+ def test_fs_idbfs_sync (self , extra ):
1379
1383
self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , '$ccall' )
1380
- for extra in [[], ['-DEXTRA_WORK' ]]:
1381
- secret = str (time .time ())
1382
- self .btest ('fs/test_idbfs_sync.c' , '1' , args = ['-lidbfs.js' , '-DFIRST' , f'-DSECRET="{ secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ])
1383
- self .btest ('fs/test_idbfs_sync.c' , '1' , args = ['-lidbfs.js' , f'-DSECRET="{ secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ] + extra )
1384
+ secret = str (time .time ())
1385
+ self .btest ('fs/test_idbfs_sync.c' , '1' , args = ['-lidbfs.js' , '-DFIRST' , f'-DSECRET="{ secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ])
1386
+ self .btest ('fs/test_idbfs_sync.c' , '1' , args = ['-lidbfs.js' , f'-DSECRET="{ secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ] + extra )
1384
1387
1385
1388
def test_fs_idbfs_sync_force_exit (self ):
1386
1389
self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , '$ccall' )
@@ -1800,16 +1803,19 @@ def test_glgears_long(self, args):
1800
1803
self .btest ('hello_world_gles.c' , expected = '0' , args = args )
1801
1804
1802
1805
@requires_graphics_hardware
1803
- def test_glgears_animation (self ):
1804
- for filename in ['hello_world_gles.c' , 'hello_world_gles_full.c' , 'hello_world_gles_full_944.c' ]:
1805
- print (filename )
1806
- args = ['-o' , 'something.html' ,
1807
- '-DHAVE_BUILTIN_SINCOS' , '-sGL_TESTING' , '-lGL' , '-lglut' ,
1808
- '--shell-file' , test_file ('hello_world_gles_shell.html' )]
1809
- if 'full' in filename :
1810
- args += ['-sFULL_ES2' ]
1811
- self .compile_btest (filename , args )
1812
- self .run_browser ('something.html' , '/report_gl_result?true' )
1806
+ @parameterized ({
1807
+ '' : ('hello_world_gles.c' ,),
1808
+ 'full' : ('hello_world_gles_full.c' ,),
1809
+ 'full_944' : ('hello_world_gles_full_944.c' ,),
1810
+ })
1811
+ def test_glgears_animation (self , filename ):
1812
+ args = ['-o' , 'something.html' ,
1813
+ '-DHAVE_BUILTIN_SINCOS' , '-sGL_TESTING' , '-lGL' , '-lglut' ,
1814
+ '--shell-file' , test_file ('hello_world_gles_shell.html' )]
1815
+ if 'full' in filename :
1816
+ args += ['-sFULL_ES2' ]
1817
+ self .compile_btest (filename , args )
1818
+ self .run_browser ('something.html' , '/report_gl_result?true' )
1813
1819
1814
1820
@requires_graphics_hardware
1815
1821
def test_fulles2_sdlproc (self ):
@@ -2712,27 +2718,37 @@ def test_html5_core(self, opts):
2712
2718
self .btest_exit ('test_html5_core.c' , args = opts )
2713
2719
2714
2720
@requires_threads
2715
- def test_html5_gamepad (self ):
2716
- for opts in [[], ['-O2' , '-g1' , '--closure=1' ], ['-pthread' , '-sPROXY_TO_PTHREAD' ]]:
2717
- print (opts )
2718
- self .btest_exit ('test_gamepad.c' , args = [] + opts )
2721
+ @parameterized ({
2722
+ '' : ([],),
2723
+ 'closure' : (['-O2' , '-g1' , '--closure=1' ],),
2724
+ 'pthread' : (['-pthread' , '-sPROXY_TO_PTHREAD' ],),
2725
+ })
2726
+ def test_html5_gamepad (self , args ):
2727
+ self .btest_exit ('test_gamepad.c' , args = args )
2719
2728
2720
2729
def test_html5_unknown_event_target (self ):
2721
2730
self .btest_exit ('test_html5_unknown_event_target.cpp' )
2722
2731
2723
2732
@requires_graphics_hardware
2724
- def test_html5_webgl_create_context_no_antialias (self ):
2725
- for opts in [[], ['-O2' , '-g1' , '--closure=1' ], ['-sFULL_ES2' ]]:
2726
- print (opts )
2727
- self .btest_exit ('webgl_create_context.cpp' , args = opts + ['-DNO_ANTIALIAS' , '-lGL' ])
2733
+ @parameterized ({
2734
+ '' : ([],),
2735
+ 'closure' : (['-O2' , '-g1' , '--closure=1' ],),
2736
+ 'full_es2' : (['-sFULL_ES2' ],),
2737
+ })
2738
+ def test_html5_webgl_create_context_no_antialias (self , args ):
2739
+ self .btest_exit ('webgl_create_context.cpp' , args = args + ['-DNO_ANTIALIAS' , '-lGL' ])
2728
2740
2729
2741
# This test supersedes the one above, but it's skipped in the CI because anti-aliasing is not well supported by the Mesa software renderer.
2730
2742
@requires_threads
2731
2743
@requires_graphics_hardware
2732
- def test_html5_webgl_create_context (self ):
2733
- for opts in [[], ['-O2' , '-g1' , '--closure=1' ], ['-sFULL_ES2' ], ['-pthread' ]]:
2734
- print (opts )
2735
- self .btest_exit ('webgl_create_context.cpp' , args = opts + ['-lGL' ])
2744
+ @parameterized ({
2745
+ '' : ([],),
2746
+ 'closure' : (['-O2' , '-g1' , '--closure=1' ],),
2747
+ 'full_es2' : (['-sFULL_ES2' ],),
2748
+ 'pthread' : (['-pthread' ],),
2749
+ })
2750
+ def test_html5_webgl_create_context (self , args ):
2751
+ self .btest_exit ('webgl_create_context.cpp' , args = args + ['-lGL' ])
2736
2752
2737
2753
@requires_graphics_hardware
2738
2754
# Verify bug https://github.com/emscripten-core/emscripten/issues/4556: creating a WebGL context to Module.canvas without an ID explicitly assigned to it.
@@ -4095,9 +4111,12 @@ def test_pthread_cleanup(self):
4095
4111
4096
4112
# Tests the pthread mutex api.
4097
4113
@requires_threads
4098
- def test_pthread_mutex (self ):
4099
- for arg in [[], ['-DSPINLOCK_TEST' ]]:
4100
- self .btest_exit ('pthread/test_pthread_mutex.cpp' , args = ['-sINITIAL_MEMORY=64MB' , '-O3' , '-pthread' , '-sPTHREAD_POOL_SIZE=8' ] + arg )
4114
+ @parameterized ({
4115
+ '' : ([],),
4116
+ 'spinlock' : (['-DSPINLOCK_TEST' ],),
4117
+ })
4118
+ def test_pthread_mutex (self , args ):
4119
+ self .btest_exit ('pthread/test_pthread_mutex.cpp' , args = ['-sINITIAL_MEMORY=64MB' , '-O3' , '-pthread' , '-sPTHREAD_POOL_SIZE=8' ] + args )
4101
4120
4102
4121
@requires_threads
4103
4122
def test_pthread_attr_getstack (self ):
@@ -5065,22 +5084,25 @@ def test_single_file_html(self):
5065
5084
self .assertNotExists ('test.mem' )
5066
5085
5067
5086
# Tests that SINGLE_FILE works as intended in generated HTML with MINIMAL_RUNTIME
5087
+ @parameterized ({
5088
+ '' : ([],),
5089
+ 'O3' : (['-sWASM=0' ],)
5090
+ })
5068
5091
@parameterized ({
5069
5092
'' : ([],),
5070
5093
'wasm2js' : (['-sWASM=0' ],)
5071
5094
})
5072
- def test_minimal_runtime_single_file_html (self , args ):
5073
- if args :
5095
+ def test_minimal_runtime_single_file_html (self , args , opts ):
5096
+ if '-sWASM=0' in args :
5074
5097
self .require_wasm2js ()
5075
- for opts in [[], ['-O3' ]]:
5076
- self .btest ('single_file_static_initializer.cpp' , '19' , args = opts + args + ['-sMINIMAL_RUNTIME' , '-sSINGLE_FILE' ])
5077
- self .assertExists ('test.html' )
5078
- self .assertNotExists ('test.js' )
5079
- self .assertNotExists ('test.wasm' )
5080
- self .assertNotExists ('test.asm.js' )
5081
- self .assertNotExists ('test.mem' )
5082
- self .assertNotExists ('test.js' )
5083
- self .assertNotExists ('test.worker.js' )
5098
+ self .btest ('single_file_static_initializer.cpp' , '19' , args = opts + args + ['-sMINIMAL_RUNTIME' , '-sSINGLE_FILE' ])
5099
+ self .assertExists ('test.html' )
5100
+ self .assertNotExists ('test.js' )
5101
+ self .assertNotExists ('test.wasm' )
5102
+ self .assertNotExists ('test.asm.js' )
5103
+ self .assertNotExists ('test.mem' )
5104
+ self .assertNotExists ('test.js' )
5105
+ self .assertNotExists ('test.worker.js' )
5084
5106
5085
5107
# Tests that SINGLE_FILE works when built with ENVIRONMENT=web and Closure enabled (#7933)
5086
5108
def test_single_file_in_web_environment_with_closure (self ):
@@ -5312,18 +5334,20 @@ def test_no_declare_asm_module_exports_wasm_minimal_runtime(self, mode):
5312
5334
self .btest_exit ('declare_asm_module_exports.c' , args = ['-sDECLARE_ASM_MODULE_EXPORTS=0' , '-sENVIRONMENT=web' , '-O3' , '--closure=1' , f'-sMINIMAL_RUNTIME={ mode } ' ])
5313
5335
5314
5336
# Tests that the different code paths in src/shell_minimal_runtime.html all work ok.
5337
+ @parameterized ({
5338
+ '' : ([],),
5339
+ 'modularize' : (['-sMODULARIZE' ],),
5340
+ })
5315
5341
@parameterized ({
5316
5342
'' : ([],),
5317
5343
'wasm2js' : (['-sWASM=0' , '--memory-init-file' , '0' ],),
5318
5344
'wasm2js_mem_init_file' : (['-sWASM=0' , '--memory-init-file' , '1' ],),
5319
5345
})
5320
- def test_minimal_runtime_loader_shell (self , wasm_args ):
5346
+ def test_minimal_runtime_loader_shell (self , wasm_args , modularize ):
5321
5347
args = ['-sMINIMAL_RUNTIME=2' ]
5322
5348
if wasm_args :
5323
5349
self .require_wasm2js ()
5324
- for modularize in [[], ['-sMODULARIZE' ]]:
5325
- print (str (modularize ))
5326
- self .btest_exit ('minimal_hello.c' , args = args + wasm_args + modularize )
5350
+ self .btest_exit ('minimal_hello.c' , args = args + wasm_args + modularize )
5327
5351
5328
5352
# Tests that -sMINIMAL_RUNTIME works well in different build modes
5329
5353
@parameterized ({
0 commit comments