@@ -67,6 +67,22 @@ def decorated(self, *args, **kwargs):
6767 return decorator
6868
6969
70+ def no_esm_integration (note ):
71+ assert not callable (note )
72+
73+ def decorator (f ):
74+ assert callable (f )
75+
76+ @wraps (f )
77+ def decorated (self , * args , ** kwargs ):
78+ if self .get_setting ('WASM_ESM_INTEGRATION' ):
79+ self .skipTest (note )
80+ f (self , * args , ** kwargs )
81+ return decorated
82+
83+ return decorator
84+
85+
7086def wasm_simd (f ):
7187 assert callable (f )
7288
@@ -189,6 +205,8 @@ def with_asyncify_and_jspi(f):
189205
190206 @wraps (f )
191207 def metafunc (self , jspi , * args , ** kwargs ):
208+ if self .get_setting ('WASM_ESM_INTEGRATION' ):
209+ self .skipTest ('WASM_ESM_INTEGRATION is not compatible with ASYNCIFY' )
192210 if jspi :
193211 self .set_setting ('ASYNCIFY' , 2 )
194212 self .require_jspi ()
@@ -208,6 +226,8 @@ def also_with_asyncify_and_jspi(f):
208226
209227 @wraps (f )
210228 def metafunc (self , asyncify , * args , ** kwargs ):
229+ if asyncify and self .get_setting ('WASM_ESM_INTEGRATION' ):
230+ self .skipTest ('WASM_ESM_INTEGRATION is not compatible with ASYNCIFY' )
211231 if asyncify == 2 :
212232 self .set_setting ('ASYNCIFY' , 2 )
213233 self .require_jspi ()
@@ -437,6 +457,7 @@ def get_bullet_library(self, use_cmake):
437457 def test_hello_world (self ):
438458 self .do_core_test ('test_hello_world.c' )
439459
460+ @no_esm_integration ('WASM_ASYNC_COMPILATION=0' )
440461 def test_wasm_synchronous_compilation (self ):
441462 if self .get_setting ('MODULARIZE' ) != 'instance' :
442463 self .set_setting ('STRICT_JS' )
@@ -927,6 +948,7 @@ def test_longjmp(self):
927948 self .do_core_test ('test_longjmp.c' )
928949
929950 @no_sanitize ('sanitizers do not support WASM_WORKERS' )
951+ @no_esm_integration ('WASM_ESM_INTEGRATION is not compatible with WASM_WORKERS' )
930952 def test_longjmp_wasm_workers (self ):
931953 self .do_core_test ('test_longjmp.c' , emcc_args = ['-sWASM_WORKERS' ])
932954
@@ -2008,7 +2030,11 @@ def test_em_js(self, args, force_c):
20082030 self .setup_node_pthreads ()
20092031
20102032 self .do_core_test ('test_em_js.cpp' , force_c = force_c )
2011- self .assertContained ('no args returning int' , read_file (self .output_name ('test_em_js' )))
2033+ if self .get_setting ('WASM_ESM_INTEGRATION' ):
2034+ js_out = 'test_em_js.support.mjs'
2035+ else :
2036+ js_out = self .output_name ('test_em_js' )
2037+ self .assertContained ('no args returning int' , read_file (js_out ))
20122038
20132039 @no_wasm2js ('test depends on WASM_BIGINT which is not compatible with wasm2js' )
20142040 def test_em_js_i64 (self ):
@@ -2186,6 +2212,7 @@ def test_nothrow_new(self, args):
21862212 @no_lsan ('LSan alters the memory size' )
21872213 @no_4gb ('depends on memory size' )
21882214 @no_2gb ('depends on memory size' )
2215+ @no_esm_integration ('external wasmMemory' )
21892216 def test_module_wasm_memory (self ):
21902217 self .emcc_args += ['--pre-js' , test_file ('core/test_module_wasm_memory.js' )]
21912218 self .set_setting ('IMPORTED_MEMORY' )
@@ -6998,7 +7025,6 @@ def test_EXPORTED_RUNTIME_METHODS(self):
69987025
69997026 @also_with_minimal_runtime
70007027 @no_modularize_instance ('uses dynCallLegacy' )
7001- @no_wasm64 ('not compatible with MEMORY64' )
70027028 def test_dyncall_specific (self ):
70037029 if self .get_setting ('WASM_BIGINT' ) != 0 and not self .is_wasm2js ():
70047030 # define DYNCALLS because this test does test calling them directly, and
@@ -7462,6 +7488,7 @@ def test_embind_negative_constants(self):
74627488 self .do_run_in_out_file_test ('embind/test_negative_constants.cpp' , emcc_args = ['-lembind' ])
74637489
74647490 @also_with_wasm_bigint
7491+ @no_esm_integration ('embind is not compatible with WASM_ESM_INTEGRATION' )
74657492 def test_embind_unsigned (self ):
74667493 self .do_run_in_out_file_test ('embind/test_unsigned.cpp' , emcc_args = ['-lembind' ])
74677494
@@ -7637,6 +7664,7 @@ def test_embind_no_rtti_followed_by_rtti(self):
76377664 self .do_run (src , '418\n dotest returned: 42\n ' )
76387665
76397666 @no_sanitize ('sanitizers do not support WASM_WORKERS' )
7667+ @no_esm_integration ('WASM_ESM_INTEGRATION is not compatible with WASM_WORKERS' )
76407668 def test_embind_wasm_workers (self ):
76417669 self .do_run_in_out_file_test ('embind/test_embind_wasm_workers.cpp' , emcc_args = ['-lembind' , '-sWASM_WORKERS' ])
76427670
@@ -7812,6 +7840,7 @@ def test_embind_dylink_visibility_hidden(self):
78127840 self .do_runf ('main.cpp' , 'done\n ' , emcc_args = ['--bind' ])
78137841
78147842 @no_wasm2js ('TODO: source maps in wasm2js' )
7843+ @no_esm_integration ('WASM_ESM_INTEGRATION is not compatible with dwarf output' )
78157844 def test_dwarf (self ):
78167845 self .emcc_args .append ('-g' )
78177846
@@ -8254,6 +8283,7 @@ def test_asyncify_lists(self, args, should_pass, response=None):
82548283 binary = read_binary (filename )
82558284 self .assertFalse (b'main' in binary )
82568285
8286+ @no_esm_integration ('WASM_ESM_INTEGRATION is not compatible with ASYNCIFY' )
82578287 @parameterized ({
82588288 'normal' : ([], True ),
82598289 'ignoreindirect' : (['-sASYNCIFY_IGNORE_INDIRECT' ], False ),
@@ -8645,7 +8675,10 @@ def test_environment(self):
86458675
86468676 def test (assert_returncode = 0 ):
86478677 self .do_core_test ('test_hello_world.c' , assert_returncode = assert_returncode )
8648- js = read_file (self .output_name ('test_hello_world' ))
8678+ if self .get_setting ('WASM_ESM_INTEGRATION' ):
8679+ js = read_file (self .output_name ('test_hello_world.support' ))
8680+ else :
8681+ js = read_file (self .output_name ('test_hello_world' ))
86498682 assert ('require(' in js ) == ('node' in self .get_setting ('ENVIRONMENT' )), 'we should have require() calls only if node js specified'
86508683
86518684 for engine in config .JS_ENGINES :
@@ -8770,11 +8803,13 @@ def test_minimal_runtime_global_initializer(self):
87708803 self .do_runf ('test_global_initializer.cpp' , 't1 > t0: 1' )
87718804
87728805 @no_wasm2js ('wasm2js does not support PROXY_TO_PTHREAD (custom section support)' )
8806+ @no_esm_integration ('USE_OFFSET_CONVERTER' )
87738807 def test_return_address (self ):
87748808 self .set_setting ('USE_OFFSET_CONVERTER' )
87758809 self .do_runf ('core/test_return_address.c' , 'passed' )
87768810
87778811 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8812+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
87788813 @no_asan ('-fsanitize-minimal-runtime cannot be used with ASan' )
87798814 @no_lsan ('-fsanitize-minimal-runtime cannot be used with LSan' )
87808815 def test_ubsan_minimal_too_many_errors (self ):
@@ -8784,6 +8819,7 @@ def test_ubsan_minimal_too_many_errors(self):
87848819 regex = True )
87858820
87868821 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8822+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
87878823 @no_asan ('-fsanitize-minimal-runtime cannot be used with ASan' )
87888824 @no_lsan ('-fsanitize-minimal-runtime cannot be used with LSan' )
87898825 def test_ubsan_minimal_errors_same_place (self ):
@@ -8798,6 +8834,7 @@ def test_ubsan_minimal_errors_same_place(self):
87988834 'fsanitize_overflow' : (['-fsanitize=signed-integer-overflow' ],),
87998835 })
88008836 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8837+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88018838 def test_ubsan_full_overflow (self , args ):
88028839 self .emcc_args += args
88038840 self .do_runf (
@@ -8813,6 +8850,7 @@ def test_ubsan_full_overflow(self, args):
88138850 'fsanitize_return' : (['-fsanitize=return' ],),
88148851 })
88158852 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8853+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88168854 def test_ubsan_full_no_return (self , args ):
88178855 self .emcc_args += ['-Wno-return-type' ] + args
88188856 self .do_runf ('core/test_ubsan_full_no_return.cpp' ,
@@ -8824,6 +8862,7 @@ def test_ubsan_full_no_return(self, args):
88248862 'fsanitize_shift' : (['-fsanitize=shift' ],),
88258863 })
88268864 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8865+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88278866 def test_ubsan_full_left_shift (self , args ):
88288867 self .emcc_args += args
88298868 self .do_runf (
@@ -8840,6 +8879,7 @@ def test_ubsan_full_left_shift(self, args):
88408879 'dylink' : (['-fsanitize=null' , '-sMAIN_MODULE=2' ],),
88418880 })
88428881 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8882+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88438883 def test_ubsan_full_null_ref (self , args ):
88448884 if '-sMAIN_MODULE=2' in args :
88458885 self .check_dylink ()
@@ -8856,6 +8896,7 @@ def test_ubsan_full_null_ref(self, args):
88568896 ])
88578897
88588898 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8899+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88598900 def test_sanitize_vptr (self ):
88608901 self .do_runf (
88618902 'core/test_sanitize_vptr.cpp' ,
@@ -8878,6 +8919,7 @@ def test_sanitize_vptr(self):
88788919 ]),
88798920 })
88808921 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8922+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88818923 def test_ubsan_full_stack_trace (self , g_flag , expected_output ):
88828924 if g_flag == '-gsource-map' :
88838925 if self .is_wasm2js ():
@@ -8892,6 +8934,7 @@ def test_ubsan_full_stack_trace(self, g_flag, expected_output):
88928934 assert_all = True , expected_output = expected_output )
88938935
88948936 @no_wasm2js ('TODO: sanitizers in wasm2js' )
8937+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
88958938 def test_ubsan_typeinfo_eq (self ):
88968939 # https://github.com/emscripten-core/emscripten/issues/13330
88978940 src = r'''
@@ -8911,6 +8954,7 @@ def test_template_class_deduction(self):
89118954 self .do_core_test ('test_template_class_deduction.cpp' )
89128955
89138956 @no_wasm2js ('TODO: ASAN in wasm2js' )
8957+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
89148958 @no_safe_heap ('asan does not work with SAFE_HEAP' )
89158959 @no_wasm64 ('TODO: ASAN in memory64' )
89168960 @no_2gb ('asan doesnt support GLOBAL_BASE' )
@@ -8931,6 +8975,7 @@ def test_asan_no_error(self, name):
89318975 @no_safe_heap ('asan does not work with SAFE_HEAP' )
89328976 @no_wasm64 ('TODO: ASAN in memory64' )
89338977 @no_2gb ('asan doesnt support GLOBAL_BASE' )
8978+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
89348979 @parameterized ({
89358980 'use_after_free_c' : ('test_asan_use_after_free.c' , [
89368981 'AddressSanitizer: heap-use-after-free on address' ,
@@ -9004,6 +9049,7 @@ def test_asan(self, name, expected_output, cflags=None):
90049049 @no_wasm2js ('TODO: ASAN in wasm2js' )
90059050 @no_wasm64 ('TODO: ASAN in memory64' )
90069051 @no_2gb ('asan doesnt support GLOBAL_BASE' )
9052+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
90079053 def test_asan_js_stack_op (self ):
90089054 self .emcc_args .append ('-fsanitize=address' )
90099055 self .set_setting ('ALLOW_MEMORY_GROWTH' )
@@ -9015,6 +9061,7 @@ def test_asan_js_stack_op(self):
90159061 @no_wasm2js ('TODO: ASAN in wasm2js' )
90169062 @no_wasm64 ('TODO: ASAN in memory64' )
90179063 @no_2gb ('asan doesnt support GLOBAL_BASE' )
9064+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
90189065 def test_asan_api (self ):
90199066 self .emcc_args .append ('-fsanitize=address' )
90209067 self .set_setting ('INITIAL_MEMORY' , '300mb' )
@@ -9024,6 +9071,7 @@ def test_asan_api(self):
90249071 @no_wasm2js ('TODO: ASAN in wasm2js' )
90259072 @no_wasm64 ('TODO: ASAN in memory64' )
90269073 @no_2gb ('asan doesnt support GLOBAL_BASE' )
9074+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
90279075 def test_asan_modularized_with_closure (self ):
90289076 # the bug is that createModule() returns undefined, instead of the
90299077 # proper Promise object.
@@ -9038,6 +9086,7 @@ def test_asan_modularized_with_closure(self):
90389086
90399087 @no_asan ('SAFE_HEAP cannot be used with ASan' )
90409088 @no_2gb ('asan doesnt support GLOBAL_BASE' )
9089+ @no_esm_integration ('sanitizers do not support WASM_ESM_INTEGRATION' )
90419090 def test_safe_heap_user_js (self ):
90429091 self .set_setting ('SAFE_HEAP' )
90439092 self .do_runf ('core/test_safe_heap_user_js.c' ,
@@ -9429,6 +9478,7 @@ def test_Module_dynamicLibraries(self, args):
94299478
94309479 # Tests the emscripten_get_exported_function() API.
94319480 @also_with_minimal_runtime
9481+ @no_esm_integration ('depends on wasmExports' )
94329482 def test_get_exported_function (self ):
94339483 self .set_setting ('ALLOW_TABLE_GROWTH' )
94349484 self .emcc_args += ['-lexports.js' ]
0 commit comments