@@ -1375,12 +1375,15 @@ def test_write_file_in_environment_web(self):
13751375 def test_fflush (self ):
13761376 self .btest ('test_fflush.cpp' , '0' , args = ['-sEXIT_RUNTIME' , '--shell-file' , test_file ('test_fflush.html' )], reporting = Reporting .NONE )
13771377
1378- def test_fs_idbfs_sync (self ):
1378+ @parameterized ({
1379+ '' : ([],),
1380+ 'extra' : (['-DEXTRA_WORK' ],),
1381+ })
1382+ def test_fs_idbfs_sync (self , extra ):
13791383 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 )
13841387
13851388 def test_fs_idbfs_sync_force_exit (self ):
13861389 self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , '$ccall' )
@@ -1800,16 +1803,19 @@ def test_glgears_long(self, args):
18001803 self .btest ('hello_world_gles.c' , expected = '0' , args = args )
18011804
18021805 @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' )
18131819
18141820 @requires_graphics_hardware
18151821 def test_fulles2_sdlproc (self ):
@@ -2712,27 +2718,37 @@ def test_html5_core(self, opts):
27122718 self .btest_exit ('test_html5_core.c' , args = opts )
27132719
27142720 @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 )
27192728
27202729 def test_html5_unknown_event_target (self ):
27212730 self .btest_exit ('test_html5_unknown_event_target.cpp' )
27222731
27232732 @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' ])
27282740
27292741 # 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.
27302742 @requires_threads
27312743 @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' ])
27362752
27372753 @requires_graphics_hardware
27382754 # 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):
40954111
40964112 # Tests the pthread mutex api.
40974113 @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 )
41014120
41024121 @requires_threads
41034122 def test_pthread_attr_getstack (self ):
@@ -5065,22 +5084,25 @@ def test_single_file_html(self):
50655084 self .assertNotExists ('test.mem' )
50665085
50675086 # Tests that SINGLE_FILE works as intended in generated HTML with MINIMAL_RUNTIME
5087+ @parameterized ({
5088+ '' : ([],),
5089+ 'O3' : (['-sWASM=0' ],)
5090+ })
50685091 @parameterized ({
50695092 '' : ([],),
50705093 'wasm2js' : (['-sWASM=0' ],)
50715094 })
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 :
50745097 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' )
50845106
50855107 # Tests that SINGLE_FILE works when built with ENVIRONMENT=web and Closure enabled (#7933)
50865108 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):
53125334 self .btest_exit ('declare_asm_module_exports.c' , args = ['-sDECLARE_ASM_MODULE_EXPORTS=0' , '-sENVIRONMENT=web' , '-O3' , '--closure=1' , f'-sMINIMAL_RUNTIME={ mode } ' ])
53135335
53145336 # Tests that the different code paths in src/shell_minimal_runtime.html all work ok.
5337+ @parameterized ({
5338+ '' : ([],),
5339+ 'modularize' : (['-sMODULARIZE' ],),
5340+ })
53155341 @parameterized ({
53165342 '' : ([],),
53175343 'wasm2js' : (['-sWASM=0' , '--memory-init-file' , '0' ],),
53185344 'wasm2js_mem_init_file' : (['-sWASM=0' , '--memory-init-file' , '1' ],),
53195345 })
5320- def test_minimal_runtime_loader_shell (self , wasm_args ):
5346+ def test_minimal_runtime_loader_shell (self , wasm_args , modularize ):
53215347 args = ['-sMINIMAL_RUNTIME=2' ]
53225348 if wasm_args :
53235349 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 )
53275351
53285352 # Tests that -sMINIMAL_RUNTIME works well in different build modes
53295353 @parameterized ({
0 commit comments