@@ -199,6 +199,17 @@ def decorated(self, *args, **kwargs):
199
199
return decorated
200
200
201
201
202
+ def requires_jspi(func):
203
+ assert callable(func)
204
+
205
+ @wraps(func)
206
+ def decorated(self, *args, **kwargs):
207
+ self.require_jspi()
208
+ return func(self, *args, **kwargs)
209
+
210
+ return decorated
211
+
212
+
202
213
def llvm_nm(file):
203
214
output = shared.run_process([LLVM_NM, file], stdout=PIPE).stdout
204
215
@@ -3061,8 +3072,8 @@ def test_embind_asyncify(self):
3061
3072
'': ['-sDYNAMIC_EXECUTION=1'],
3062
3073
'no_dynamic': ['-sDYNAMIC_EXECUTION=0'],
3063
3074
})
3075
+ @requires_jspi
3064
3076
def test_embind_jspi(self, extra):
3065
- self.require_jspi()
3066
3077
self.emcc_args += ['-lembind', '-g']
3067
3078
self.emcc_args += [extra]
3068
3079
@@ -3202,19 +3213,19 @@ def test_embind_return_value_policy(self):
3202
3213
3203
3214
self.do_runf('embind/test_return_value_policy.cpp')
3204
3215
3216
+ @requires_jspi
3205
3217
@parameterized({
3206
3218
'': [['-sJSPI_EXPORTS=async*']],
3207
3219
'deprecated': [['-Wno-deprecated', '-sASYNCIFY_EXPORTS=async*']]
3208
3220
})
3209
3221
def test_jspi_wildcard(self, opts):
3210
- self.require_jspi()
3211
3222
self.emcc_args += opts
3212
3223
3213
3224
self.do_runf('other/test_jspi_wildcard.c', 'done')
3214
3225
3226
+ @requires_jspi
3215
3227
def test_jspi_add_function(self):
3216
3228
# make sure synchronous functions in the wasmTable aren't processed with Asyncify.makeAsyncFunction
3217
- self.require_jspi()
3218
3229
self.emcc_args += [
3219
3230
'-sASYNCIFY=2',
3220
3231
'-sEXPORTED_RUNTIME_METHODS=addFunction,dynCall',
0 commit comments