@@ -1432,14 +1432,14 @@ def test_fs_workerfs(self):
14321432 }, '/work');
14331433 };
14341434 ''' )
1435- self .btest_exit ('fs/test_workerfs.c' , cflags = ['-lworkerfs.js' , '--pre-js' , 'pre.js' , '--proxy-to-worker' , '-Wno-deprecated' , '-lworkerfs.js' ] )
1435+ self .btest_exit ('fs/test_workerfs.c' , cflags = ['-lworkerfs.js' , '--pre-js' , 'pre.js' ], run_in_worker = True )
14361436
14371437 def test_fs_workerfs_package (self ):
14381438 create_file ('file1.txt' , 'first' )
14391439 ensure_dir ('sub' )
14401440 create_file ('sub/file2.txt' , 'second' )
14411441 self .run_process ([FILE_PACKAGER , 'files.data' , '--preload' , 'file1.txt' , 'sub/file2.txt' , '--separate-metadata' , '--js-output=files.js' ])
1442- self .btest ('fs/test_workerfs_package.c' , '1 ' , cflags = ['-lworkerfs.js' , '--proxy-to-worker' , '-Wno-deprecated' , '-lworkerfs.js' ] )
1442+ self .btest ('fs/test_workerfs_package.c' , '0 ' , cflags = ['-lworkerfs.js' ], run_in_worker = True )
14431443
14441444 def test_fs_lz4fs_package (self ):
14451445 # generate data
@@ -1691,8 +1691,7 @@ def test_mmap_lazyfile(self):
16911691 FS.createLazyFile('/', "lazy.txt", "lazydata.dat", true, false);
16921692 }
16931693 ''' )
1694- self .cflags += ['--pre-js=pre.js' , '--proxy-to-worker' , '-Wno-deprecated' ]
1695- self .btest_exit ('test_mmap_lazyfile.c' )
1694+ self .btest_exit ('test_mmap_lazyfile.c' , cflags = ['--pre-js=pre.js' ], run_in_worker = True )
16961695
16971696 @no_wasmfs ('https://github.com/emscripten-core/emscripten/issues/19608' )
16981697 @no_firefox ('keeps sending OPTIONS requests, and eventually errors' )
@@ -3634,8 +3633,8 @@ def test_dlopen_blocking(self):
36343633 # verify that dynamic linking works in all kinds of in-browser environments.
36353634 # don't mix different kinds in a single test.
36363635 @parameterized ({
3637- '' : (0 ,),
3638- 'inworker' : (1 ,),
3636+ '' : (False ,),
3637+ 'inworker' : (True ,),
36393638 })
36403639 def test_dylink_dso_needed (self , inworker ):
36413640 if not inworker :
@@ -3669,10 +3668,7 @@ def do_run(src, expected_output, cflags):
36693668 return rtn;
36703669 }
36713670 ''' % expected_output )
3672- # --proxy-to-worker only when linking the main module
3673- if inworker :
3674- cflags += ['--proxy-to-worker' , '-Wno-deprecated' ]
3675- self .btest_exit ('test_dylink_dso_needed.c' , cflags = ['--post-js' , 'post.js' ] + cflags )
3671+ self .btest_exit ('test_dylink_dso_needed.c' , cflags = ['--post-js' , 'post.js' ] + cflags , run_in_worker = inworker )
36763672
36773673 self ._test_dylink_dso_needed (do_run )
36783674
@@ -4651,12 +4647,12 @@ def test_fetch_sync(self):
46514647 shutil .copy (test_file ('gears.png' ), '.' )
46524648 self .btest_exit ('fetch/test_fetch_sync.c' , cflags = ['-sFETCH' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
46534649
4654- # Tests that the Fetch API works for synchronous XHRs when used with --proxy-to- worker.
4650+ # Tests that the Fetch API works for synchronous XHRs when program is run in a worker
46554651 @no_firefox ('https://github.com/emscripten-core/emscripten/issues/16868' )
46564652 @also_with_wasm2js
46574653 def test_fetch_sync_xhr_in_proxy_to_worker (self ):
46584654 shutil .copy (test_file ('gears.png' ), '.' )
4659- self .btest_exit ('fetch/test_fetch_sync_xhr.cpp' , cflags = ['-sFETCH_DEBUG' , '-sFETCH' , '--proxy-to-worker' , '-Wno-deprecated' ] )
4655+ self .btest_exit ('fetch/test_fetch_sync_xhr.cpp' , cflags = ['-sFETCH_DEBUG' , '-sFETCH' ], run_in_worker = True )
46604656
46614657 @disabled ('https://github.com/emscripten-core/emscripten/issues/16746' )
46624658 def test_fetch_idb_store (self ):
@@ -4914,11 +4910,7 @@ def test_single_file_locate_file(self):
49144910
49154911 # Tests that SINGLE_FILE works as intended in a Worker in JS output
49164912 def test_single_file_worker_js (self ):
4917- self .compile_btest ('browser_test_hello_world.c' , ['-o' , 'test.js' , '--proxy-to-worker' , '-Wno-deprecated' , '-sSINGLE_FILE' ])
4918- create_file ('test.html' , '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body><script src="test.js"></script></body></html>' )
4919- self .run_browser ('test.html' , '/report_result?0' )
4920- self .assertExists ('test.js' )
4921- self .assertNotExists ('test.worker.js' )
4913+ self .btest_exit ('browser_test_hello_world.c' , cflags = ['-sSINGLE_FILE' ], run_in_worker = True )
49224914
49234915 # Tests that pthreads code works as intended in a Worker. That is, a pthreads-using
49244916 # program can run either on the main thread (normal tests) or when we start it in
@@ -4929,14 +4921,7 @@ def test_single_file_worker_js(self):
49294921 'limited_env' : (['-sENVIRONMENT=worker' ],),
49304922 })
49314923 def test_pthreads_started_in_worker (self , args ):
4932- self .set_setting ('EXIT_RUNTIME' )
4933- self .compile_btest ('pthread/test_pthread_atomics.c' , ['-o' , 'test.js' , '-pthread' , '-sPTHREAD_POOL_SIZE=8' ] + args , reporting = Reporting .JS_ONLY )
4934- create_file ('test.html' , '''
4935- <script>
4936- new Worker('test.js');
4937- </script>
4938- ''' )
4939- self .run_browser ('test.html' , '/report_result?exit:0' )
4924+ self .btest_exit ('pthread/test_pthread_atomics.c' , cflags = ['-o' , 'test.js' , '-pthread' , '-sPTHREAD_POOL_SIZE=8' ] + args , run_in_worker = True )
49404925
49414926 def test_access_file_after_heap_resize (self ):
49424927 create_file ('test.txt' , 'hello from file' )
0 commit comments