@@ -124,6 +124,26 @@ def metafunc(self, with_wasm64):
124
124
return metafunc
125
125
126
126
127
+ def also_with_wasm2js_or_wasm64 (f ):
128
+ assert callable (f )
129
+
130
+ def metafunc (self , with_wasm2js , with_wasm64 ):
131
+ if with_wasm2js :
132
+ self .set_setting ('WASM' , 0 )
133
+ f (self )
134
+ elif with_wasm64 :
135
+ self .set_setting ('MEMORY64' )
136
+ self .emcc_args .append ('-Wno-experimental' )
137
+ f (self )
138
+ else :
139
+ f (self )
140
+
141
+ metafunc ._parameterize = {'' : (False , False ),
142
+ 'wasm2js' : (True , False ),
143
+ 'wasm64' : (False , True )}
144
+ return metafunc
145
+
146
+
127
147
def shell_with_script (shell_file , output_file , replacement ):
128
148
shell = read_file (path_from_root ('src' , shell_file ))
129
149
create_file (output_file , shell .replace ('{{{ SCRIPT }}}' , replacement ))
@@ -4602,7 +4622,7 @@ def test_preallocated_heap(self):
4602
4622
self .btest_exit ('test_preallocated_heap.cpp' , args = ['-sWASM=0' , '-sINITIAL_MEMORY=16MB' , '-sABORTING_MALLOC=0' , '--shell-file' , test_file ('test_preallocated_heap_shell.html' )])
4603
4623
4604
4624
# Tests emscripten_fetch() usage to XHR data directly to memory without persisting results to IndexedDB.
4605
- @also_with_wasm2js
4625
+ @also_with_wasm2js_or_wasm64
4606
4626
def test_fetch_to_memory (self ):
4607
4627
# Test error reporting in the negative case when the file URL doesn't exist. (http 404)
4608
4628
self .btest_exit ('fetch/to_memory.cpp' ,
@@ -4626,29 +4646,29 @@ def test_fetch_from_thread(self, args):
4626
4646
args = args + ['-pthread' , '-sPROXY_TO_PTHREAD' , '-sFETCH_DEBUG' , '-sFETCH' , '-DFILE_DOES_NOT_EXIST' ],
4627
4647
also_wasm2js = True )
4628
4648
4629
- @also_with_wasm2js
4649
+ @also_with_wasm2js_or_wasm64
4630
4650
def test_fetch_to_indexdb (self ):
4631
4651
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4632
4652
self .btest_exit ('fetch/to_indexeddb.cpp' ,
4633
4653
args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4634
4654
4635
4655
# Tests emscripten_fetch() usage to persist an XHR into IndexedDB and subsequently load up from there.
4636
- @also_with_wasm2js
4656
+ @also_with_wasm2js_or_wasm64
4637
4657
def test_fetch_cached_xhr (self ):
4638
4658
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4639
4659
self .btest_exit ('fetch/cached_xhr.cpp' ,
4640
4660
args = ['-sFETCH_DEBUG' , '-sFETCH' ])
4641
4661
4642
4662
# Tests that response headers get set on emscripten_fetch_t values.
4643
4663
@no_firefox ('https://github.com/emscripten-core/emscripten/issues/16868' )
4644
- @also_with_wasm2js
4664
+ @also_with_wasm2js_or_wasm64
4645
4665
@requires_threads
4646
4666
def test_fetch_response_headers (self ):
4647
4667
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
4648
4668
self .btest_exit ('fetch/response_headers.cpp' , args = ['-sFETCH_DEBUG' , '-sFETCH' , '-pthread' , '-sPROXY_TO_PTHREAD' ])
4649
4669
4650
4670
# Test emscripten_fetch() usage to stream a XHR in to memory without storing the full file in memory
4651
- @also_with_wasm2js
4671
+ @also_with_wasm2js_or_wasm64
4652
4672
def test_fetch_stream_file (self ):
4653
4673
self .skipTest ('moz-chunked-arraybuffer was firefox-only and has been removed' )
4654
4674
# Strategy: create a large 128MB file, and compile with a small 16MB Emscripten heap, so that the tested file
@@ -4674,6 +4694,7 @@ def test_fetch_xhr_abort(self):
4674
4694
# Tests emscripten_fetch() usage in synchronous mode when used from the main
4675
4695
# thread proxied to a Worker with -sPROXY_TO_PTHREAD option.
4676
4696
@no_firefox ('https://github.com/emscripten-core/emscripten/issues/16868' )
4697
+ @also_with_wasm64
4677
4698
@requires_threads
4678
4699
def test_fetch_sync_xhr (self ):
4679
4700
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
@@ -4682,6 +4703,7 @@ def test_fetch_sync_xhr(self):
4682
4703
# Tests emscripten_fetch() usage when user passes none of the main 3 flags (append/replace/no_download).
4683
4704
# In that case, in append is implicitly understood.
4684
4705
@no_firefox ('https://github.com/emscripten-core/emscripten/issues/16868' )
4706
+ @also_with_wasm64
4685
4707
@requires_threads
4686
4708
def test_fetch_implicit_append (self ):
4687
4709
shutil .copyfile (test_file ('gears.png' ), 'gears.png' )
0 commit comments