@@ -51,6 +51,22 @@ def decorated(self, *args, **kwargs):
51
51
return decorated
52
52
53
53
54
+ def no_modularize_instance (note ):
55
+ assert not callable (note )
56
+
57
+ def decorator (f ):
58
+ assert callable (f )
59
+
60
+ @wraps (f )
61
+ def decorated (self , * args , ** kwargs ):
62
+ if self .get_setting ('MODULARIZE' ) == 'instance' or self .get_setting ('WASM_ESM_INTEGRATION' ):
63
+ self .skipTest (note )
64
+ f (self , * args , ** kwargs )
65
+ return decorated
66
+
67
+ return decorator
68
+
69
+
54
70
def wasm_simd (f ):
55
71
assert callable (f )
56
72
@@ -1745,6 +1761,7 @@ def test_mod_globalstruct(self):
1745
1761
def test_sizeof (self ):
1746
1762
self .do_core_test ('test_sizeof.c' )
1747
1763
1764
+ @no_modularize_instance ('uses Module object directly' )
1748
1765
def test_llvm_used (self ):
1749
1766
self .do_core_test ('test_llvm_used.c' )
1750
1767
@@ -1754,6 +1771,7 @@ def test_set_align(self):
1754
1771
1755
1772
self .do_core_test ('test_set_align.c' )
1756
1773
1774
+ @no_modularize_instance ('uses Module object directly' )
1757
1775
def test_emscripten_api (self ):
1758
1776
self .set_setting ('EXPORTED_FUNCTIONS' , ['_main' , '_save_me_aimee' ])
1759
1777
self .do_core_test ('test_emscripten_api.c' )
@@ -5347,6 +5365,7 @@ def test_sscanf_float(self):
5347
5365
def test_langinfo (self ):
5348
5366
self .do_core_test ('test_langinfo.c' )
5349
5367
5368
+ @no_modularize_instance ('uses Module object directly' )
5350
5369
def test_files (self ):
5351
5370
# Use closure here, to test we don't break FS stuff
5352
5371
if '-O3' in self .emcc_args and self .is_wasm2js ():
@@ -6217,6 +6236,7 @@ def test_jslib(self):
6217
6236
6218
6237
@with_env_modify ({'LC_ALL' : 'latin-1' , 'PYTHONUTF8' : '0' , 'PYTHONCOERCECLOCALE' : '0' })
6219
6238
@crossplatform
6239
+ @no_modularize_instance ('uses MODULARIZE' )
6220
6240
def test_unicode_js_library (self ):
6221
6241
# First verify that we have correct overridden the default python file encoding.
6222
6242
# The follow program should fail, assuming the above LC_CTYPE + PYTHONUTF8
@@ -6890,6 +6910,7 @@ def test_autodebug_wasm(self):
6890
6910
### Integration tests
6891
6911
6892
6912
@crossplatform
6913
+ @no_modularize_instance ('ccall is not compatible with WASM_ESM_INTEGRATION' )
6893
6914
def test_ccall (self ):
6894
6915
self .emcc_args .append ('-Wno-return-stack-address' )
6895
6916
self .set_setting ('EXPORTED_RUNTIME_METHODS' , ['ccall' , 'cwrap' , 'STACK_SIZE' ])
@@ -6934,6 +6955,7 @@ def test_ccall(self):
6934
6955
if self .maybe_closure ():
6935
6956
self .do_core_test ('test_ccall.cpp' )
6936
6957
6958
+ @no_modularize_instance ('ccall is not compatible with WASM_ESM_INTEGRATION' )
6937
6959
def test_ccall_cwrap_fast_path (self ):
6938
6960
self .emcc_args .append ('-Wno-return-stack-address' )
6939
6961
self .set_setting ('EXPORTED_RUNTIME_METHODS' , ['ccall' , 'cwrap' ])
@@ -6948,6 +6970,7 @@ def test_ccall_cwrap_fast_path(self):
6948
6970
self .set_setting ('EXPORTED_FUNCTIONS' , ['_print_bool' ])
6949
6971
self .do_runf ('core/test_ccall.cpp' , 'true' )
6950
6972
6973
+ @no_modularize_instance ('uses Module object directly' )
6951
6974
def test_EXPORTED_RUNTIME_METHODS (self ):
6952
6975
self .set_setting ('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE' , ['$dynCall' , '$ASSERTIONS' ])
6953
6976
self .do_core_test ('EXPORTED_RUNTIME_METHODS.c' )
@@ -6985,9 +7008,12 @@ def test_dyncall_specific(self):
6985
7008
'legacy' : (['-sDYNCALLS' ],),
6986
7009
})
6987
7010
def test_dyncall_pointers (self , args ):
7011
+ if args :
7012
+ self .skipTest ('dynCallLegacy is not yet comatible with WASM_ESM_INTEGRATION' )
6988
7013
self .do_core_test ('test_dyncall_pointers.c' , emcc_args = args )
6989
7014
6990
7015
@also_with_wasm_bigint
7016
+ @no_modularize_instance ('uses Module object directly' )
6991
7017
def test_getValue_setValue (self ):
6992
7018
# these used to be exported, but no longer are by default
6993
7019
def test (args = None , asserts = False ):
@@ -7030,6 +7056,7 @@ def test(args=None, asserts=False):
7030
7056
'' : ([],),
7031
7057
'files' : (['-DUSE_FILES' ],),
7032
7058
})
7059
+ @no_modularize_instance ('uses Module object directly' )
7033
7060
def test_FS_exports (self , extra_args ):
7034
7061
# these used to be exported, but no longer are by default
7035
7062
def test (output_prefix = '' , args = None , assert_returncode = 0 ):
@@ -7052,6 +7079,7 @@ def test(output_prefix='', args=None, assert_returncode=0):
7052
7079
self .set_setting ('EXPORTED_RUNTIME_METHODS' , ['FS_createDataFile' ])
7053
7080
test (args = ['-sFORCE_FILESYSTEM' ])
7054
7081
7082
+ @no_modularize_instance ('uses Module object directly' )
7055
7083
def test_legacy_exported_runtime_numbers (self ):
7056
7084
# these used to be exported, but no longer are by default
7057
7085
def test (expected , args = None , assert_returncode = 0 ):
@@ -7101,6 +7129,7 @@ def test_linker_response_file(self):
7101
7129
self .run_process ([EMCC , "-Wl,@rsp_file" , '-o' , 'response_file.o.js' ] + self .get_emcc_args ())
7102
7130
self .do_run ('response_file.o.js' , 'hello, world' , no_build = True )
7103
7131
7132
+ @no_modularize_instance ('uses Module object directly' )
7104
7133
def test_exported_response (self ):
7105
7134
src = r'''
7106
7135
#include <stdio.h>
@@ -7124,6 +7153,7 @@ def test_exported_response(self):
7124
7153
self .do_run (src , '''waka 5!''' )
7125
7154
assert 'other_function' in read_file ('src.js' )
7126
7155
7156
+ @no_modularize_instance ('uses Module object directly' )
7127
7157
def test_large_exported_response (self ):
7128
7158
src = r'''
7129
7159
#include <stdio.h>
@@ -7899,6 +7929,7 @@ def get_wat_addr(call_index):
7899
7929
self .assertLessEqual (start_wat_addr , dwarf_addr )
7900
7930
self .assertLessEqual (dwarf_addr , end_wat_addr )
7901
7931
7932
+ @no_modularize_instance ('uses -sMODULARIZE' )
7902
7933
def test_modularize_closure_pre (self ):
7903
7934
# test that the combination of modularize + closure + pre-js works. in that mode,
7904
7935
# closure should not minify the Module object in a way that the pre-js cannot use it.
@@ -8049,6 +8080,7 @@ def test_async_loop(self):
8049
8080
def test_async_hello_v8 (self ):
8050
8081
self .test_async_hello ()
8051
8082
8083
+ @no_modularize_instance ('ccall is not compatible with WASM_ESM_INTEGRATION' )
8052
8084
def test_async_ccall_bad (self ):
8053
8085
# check bad ccall use
8054
8086
# needs to flush stdio streams
@@ -8080,6 +8112,7 @@ def test_async_ccall_bad(self):
8080
8112
self .do_runf ('main.c' , 'The call to main is running asynchronously.' )
8081
8113
8082
8114
@with_asyncify_and_jspi
8115
+ @no_modularize_instance ('ccall is not compatible with WASM_ESM_INTEGRATION' )
8083
8116
def test_async_ccall_good (self ):
8084
8117
# check reasonable ccall use
8085
8118
self .set_setting ('ASYNCIFY' )
@@ -8108,6 +8141,7 @@ def test_async_ccall_good(self):
8108
8141
'exit_runtime' : (True ,),
8109
8142
})
8110
8143
@with_asyncify_and_jspi
8144
+ @no_modularize_instance ('ccall is not compatible with WASM_ESM_INTEGRATION' )
8111
8145
def test_async_ccall_promise (self , exit_runtime ):
8112
8146
if self .get_setting ('ASYNCIFY' ) == 2 :
8113
8147
self .set_setting ('JSPI_EXPORTS' , ['stringf' , 'floatf' ])
@@ -9550,6 +9584,7 @@ def test_promise_await_error(self):
9550
9584
self .do_runf ('core/test_promise_await.c' , 'Aborted(emscripten_promise_await is only available with ASYNCIFY)' ,
9551
9585
assert_returncode = NON_ZERO )
9552
9586
9587
+ @no_modularize_instance ('uses Module object directly' )
9553
9588
def test_emscripten_async_load_script (self ):
9554
9589
create_file ('script1.js' , 'Module._set(456);' '' )
9555
9590
create_file ('file1.txt' , 'first' )
0 commit comments