|
26 | 26 | from common import skip_if, no_windows, no_mac, is_slow_test, parameterized, parameterize |
27 | 27 | from common import env_modify, with_env_modify, disabled, flaky, node_pthreads, also_with_wasm_bigint |
28 | 28 | from common import read_file, read_binary, requires_v8, requires_node, requires_wasm2js, requires_node_canary |
29 | | -from common import compiler_for, crossplatform, no_4gb, no_2gb, also_with_minimal_runtime |
| 29 | +from common import compiler_for, crossplatform, no_4gb, no_2gb, also_with_minimal_runtime, also_with_modularize |
30 | 30 | from common import with_all_fs, also_with_nodefs, also_with_nodefs_both, also_with_noderawfs, also_with_wasmfs |
31 | 31 | from common import with_all_eh_sjlj, with_all_sjlj, also_with_standalone_wasm, can_do_standalone, no_wasm64, requires_wasm_eh |
32 | 32 | from common import NON_ZERO, WEBIDL_BINDER, EMBUILDER, PYTHON |
@@ -2424,24 +2424,17 @@ def test_pthread_equal(self): |
2424 | 2424 | self.do_run_in_out_file_test('pthread/test_pthread_equal.cpp') |
2425 | 2425 |
|
2426 | 2426 | @node_pthreads |
2427 | | - @parameterized({ |
2428 | | - '': (False,), |
2429 | | - 'modularize': (True,), |
2430 | | - }) |
2431 | | - def test_pthread_proxying(self, modularize): |
2432 | | - if modularize and self.get_setting('WASM') == 0: |
2433 | | - self.skipTest('MODULARIZE + WASM=0 + pthreads does not work (#16794)') |
| 2427 | + @also_with_modularize |
| 2428 | + def test_pthread_proxying(self): |
| 2429 | + if '-sMODULARIZE' in self.emcc_args: |
| 2430 | + if self.get_setting('WASM') == 0: |
| 2431 | + self.skipTest('MODULARIZE + WASM=0 + pthreads does not work (#16794)') |
| 2432 | + self.set_setting('EXPORT_NAME=ModuleFactory') |
2434 | 2433 | self.maybe_closure() |
2435 | 2434 | self.set_setting('PROXY_TO_PTHREAD') |
2436 | 2435 | if not self.has_changed_setting('INITIAL_MEMORY'): |
2437 | 2436 | self.set_setting('INITIAL_MEMORY=32mb') |
2438 | | - args = [] |
2439 | | - if modularize: |
2440 | | - self.set_setting('MODULARIZE') |
2441 | | - self.set_setting('EXPORT_NAME=ModuleFactory') |
2442 | | - args = ['--extern-post-js', test_file('modularize_post_js.js')] |
2443 | | - self.do_run_in_out_file_test('pthread/test_pthread_proxying.c', |
2444 | | - interleaved_output=False, emcc_args=args) |
| 2437 | + self.do_run_in_out_file_test('pthread/test_pthread_proxying.c', interleaved_output=False) |
2445 | 2438 |
|
2446 | 2439 | @node_pthreads |
2447 | 2440 | def test_pthread_proxying_cpp(self): |
@@ -9118,23 +9111,13 @@ def test_pthread_unhandledrejection(self): |
9118 | 9111 |
|
9119 | 9112 | @node_pthreads |
9120 | 9113 | @no_wasm2js('wasm2js does not support PROXY_TO_PTHREAD (custom section support)') |
| 9114 | + @also_with_modularize |
9121 | 9115 | def test_pthread_offset_converter(self): |
9122 | 9116 | self.set_setting('PROXY_TO_PTHREAD') |
9123 | 9117 | self.set_setting('EXIT_RUNTIME') |
9124 | 9118 | self.set_setting('USE_OFFSET_CONVERTER') |
9125 | | - if '-g' in self.emcc_args: |
9126 | | - self.emcc_args += ['-DDEBUG'] |
9127 | | - self.do_runf('core/test_return_address.c', 'passed') |
9128 | | - |
9129 | | - @node_pthreads |
9130 | | - @no_wasm2js('wasm2js does not support PROXY_TO_PTHREAD (custom section support)') |
9131 | | - def test_pthread_offset_converter_modularize(self): |
9132 | | - self.set_setting('PROXY_TO_PTHREAD') |
9133 | | - self.set_setting('EXIT_RUNTIME') |
9134 | | - self.set_setting('USE_OFFSET_CONVERTER') |
9135 | | - self.set_setting('MODULARIZE') |
9136 | | - self.set_setting('EXPORT_NAME', 'foo') |
9137 | | - self.emcc_args += ['--extern-post-js', test_file('modularize_post_js.js')] |
| 9119 | + if '-sMODULARIZE' in self.emcc_args: |
| 9120 | + self.set_setting('EXPORT_NAME', 'foo') |
9138 | 9121 | if '-g' in self.emcc_args: |
9139 | 9122 | self.emcc_args += ['-DDEBUG'] |
9140 | 9123 | self.do_runf('core/test_return_address.c', 'passed') |
|
0 commit comments