@@ -791,7 +791,6 @@ def test_sdl_stb_image(self):
791791
792792 def test_sdl_stb_image_bpp (self ):
793793 # load grayscale image without alpha
794- self .clear ()
795794 shutil .copyfile (test_file ('browser/test_sdl-stb-bpp1.png' ), 'screenshot.not' )
796795 self .btest ('browser/test_sdl_stb_image.c' , reference = 'browser/test_sdl-stb-bpp1.png' , args = ['-sSTB_IMAGE' , '--preload-file' , 'screenshot.not' , '-lSDL' , '-lGL' ])
797796
@@ -820,7 +819,6 @@ def test_sdl_stb_image_cleanup(self):
820819 self .btest_exit ('browser/test_sdl_stb_image_cleanup.c' , args = ['-sSTB_IMAGE' , '--preload-file' , 'screenshot.not' , '-lSDL' , '-lGL' , '--memoryprofiler' ])
821820
822821 def test_sdl_canvas (self ):
823- self .clear ()
824822 self .btest_exit ('browser/test_sdl_canvas.c' , args = ['-sLEGACY_GL_EMULATION' , '-lSDL' , '-lGL' ])
825823 # some extra coverage
826824 self .clear ()
@@ -1350,14 +1348,14 @@ def test_fs_idbfs_sync(self):
13501348 self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , '$ccall' )
13511349 for extra in [[], ['-DEXTRA_WORK' ]]:
13521350 secret = str (time .time ())
1353- self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , '-DFIRST' , '-DSECRET=\" ' + secret + ' \ " ' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ])
1354- self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , '-DSECRET=\" ' + secret + ' \ " ' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ] + extra )
1351+ self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , '-DFIRST' , f '-DSECRET=" { secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ])
1352+ self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , f '-DSECRET=" { secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-lidbfs.js' ] + extra )
13551353
13561354 def test_fs_idbfs_sync_force_exit (self ):
13571355 self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , '$ccall' )
13581356 secret = str (time .time ())
1359- self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , '-DFIRST' , '-DSECRET=\" ' + secret + ' \ " ' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-sEXIT_RUNTIME' , '-DFORCE_EXIT' , '-lidbfs.js' ])
1360- self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , '-DSECRET=\" ' + secret + ' \ " ' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-sEXIT_RUNTIME' , '-DFORCE_EXIT' , '-lidbfs.js' ])
1357+ self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , '-DFIRST' , f '-DSECRET=" { secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-sEXIT_RUNTIME' , '-DFORCE_EXIT' , '-lidbfs.js' ])
1358+ self .btest (test_file ('fs/test_idbfs_sync.c' ), '1' , args = ['-lidbfs.js' , f '-DSECRET=" { secret } "' , '-sEXPORTED_FUNCTIONS=_main,_test,_success' , '-sEXIT_RUNTIME' , '-DFORCE_EXIT' , '-lidbfs.js' ])
13611359
13621360 def test_fs_idbfs_fsync (self ):
13631361 # sync from persisted state into memory before main()
@@ -1377,13 +1375,13 @@ def test_fs_idbfs_fsync(self):
13771375
13781376 args = ['--pre-js' , 'pre.js' , '-lidbfs.js' , '-sEXIT_RUNTIME' , '-sASYNCIFY' ]
13791377 secret = str (time .time ())
1380- self .btest (test_file ('fs/test_idbfs_fsync.c' ), '1' , args = args + ['-DFIRST' , '-DSECRET=\" ' + secret + ' \ " ' , '-sEXPORTED_FUNCTIONS=_main,_success' , '-lidbfs.js' ])
1381- self .btest (test_file ('fs/test_idbfs_fsync.c' ), '1' , args = args + ['-DSECRET=\" ' + secret + ' \ " ' , '-sEXPORTED_FUNCTIONS=_main,_success' , '-lidbfs.js' ])
1378+ self .btest (test_file ('fs/test_idbfs_fsync.c' ), '1' , args = args + ['-DFIRST' , f '-DSECRET=" { secret } "' , '-sEXPORTED_FUNCTIONS=_main,_success' , '-lidbfs.js' ])
1379+ self .btest (test_file ('fs/test_idbfs_fsync.c' ), '1' , args = args + [f '-DSECRET=" { secret } "' , '-sEXPORTED_FUNCTIONS=_main,_success' , '-lidbfs.js' ])
13821380
13831381 def test_fs_memfs_fsync (self ):
13841382 args = ['-sASYNCIFY' , '-sEXIT_RUNTIME' ]
13851383 secret = str (time .time ())
1386- self .btest_exit (test_file ('fs/test_memfs_fsync.c' ), args = args + ['-DSECRET=\" ' + secret + ' \ " ' ])
1384+ self .btest_exit (test_file ('fs/test_memfs_fsync.c' ), args = args + [f '-DSECRET=" { secret } "' ])
13871385
13881386 def test_fs_workerfs_read (self ):
13891387 secret = 'a' * 10
@@ -1400,7 +1398,7 @@ def test_fs_workerfs_read(self):
14001398 }, '/work');
14011399 };
14021400 ''' % (secret , secret2 ))
1403- self .btest_exit (test_file ('fs/test_workerfs_read.c' ), args = ['-lworkerfs.js' , '--pre-js' , 'pre.js' , '-DSECRET=\" ' + secret + ' \ " ' , '-DSECRET2=\" ' + secret2 + ' \ " ' , '--proxy-to-worker' , '-lworkerfs.js' ])
1401+ self .btest_exit (test_file ('fs/test_workerfs_read.c' ), args = ['-lworkerfs.js' , '--pre-js' , 'pre.js' , f '-DSECRET=" { secret } "' , f '-DSECRET2=" { secret2 } "' , '--proxy-to-worker' , '-lworkerfs.js' ])
14041402
14051403 def test_fs_workerfs_package (self ):
14061404 self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , '$ccall' )
@@ -1479,18 +1477,18 @@ def test_separate_metadata_later(self):
14791477 def test_idbstore (self ):
14801478 secret = str (time .time ())
14811479 for stage in [0 , 1 , 2 , 3 , 0 , 1 , 2 , 0 , 0 , 1 , 4 , 2 , 5 ]:
1482- self .clear ()
14831480 print (stage )
1484- self .btest_exit (test_file ('idbstore.c' ), args = ['-lidbstore.js' , '-DSTAGE=' + str (stage ), '-DSECRET=\" ' + secret + '\" ' ])
1481+ self .btest_exit (test_file ('browser/test_idbstore.c' ),
1482+ args = ['-lidbstore.js' , f'-DSTAGE={ stage } ' , f'-DSECRET="{ secret } "' ],
1483+ output_basename = f'idbstore_{ stage } ' )
14851484
14861485 def test_idbstore_sync (self ):
14871486 secret = str (time .time ())
1488- self .clear ()
1489- self .btest (test_file ('idbstore_sync.c' ), '6' , args = ['-lidbstore.js' , '-DSECRET=\" ' + secret + '\" ' , '-O3' , '-g2' , '-sASYNCIFY' ])
1487+ self .btest (test_file ('browser/test_idbstore_sync.c' ), '6' , args = ['-lidbstore.js' , f'-DSECRET="{ secret } "' , '-O3' , '-g2' , '-sASYNCIFY' ])
14901488
14911489 def test_idbstore_sync_worker (self ):
14921490 secret = str (time .time ())
1493- self .btest (test_file ('idbstore_sync_worker .c' ), expected = '0' , args = ['-lidbstore.js' , '-DSECRET=\" ' + secret + ' \ " ' , '-O3' , '-g2' , '--proxy-to-worker' , '-sINITIAL_MEMORY=80MB' , '-sASYNCIFY' ])
1491+ self .btest (test_file ('browser/test_idbstore_sync_worker .c' ), expected = '0' , args = ['-lidbstore.js' , f '-DSECRET=" { secret } "' , '-O3' , '-g2' , '--proxy-to-worker' , '-sINITIAL_MEMORY=80MB' , '-sASYNCIFY' ])
14941492
14951493 def test_force_exit (self ):
14961494 self .btest_exit ('force_exit.c' , assert_returncode = 10 )
0 commit comments