Skip to content

Commit d173fde

Browse files
authored
[testing] Parameterize test_async optimization level. (#25254)
Speeds up the test by making it multiple tests.
1 parent 317f212 commit d173fde

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/test_browser.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,20 +3250,24 @@ def test_cocos2d_hello(self):
32503250
'-Wno-inconsistent-missing-override',
32513251
'-Wno-deprecated-declarations'])
32523252

3253+
@parameterized({
3254+
'O0': ('-O0',),
3255+
'O1': ('-O1',),
3256+
'O2': ('-O2',),
3257+
'O3': ('-O3',),
3258+
})
32533259
@parameterized({
32543260
'asyncify': (['-sASYNCIFY=1'],),
32553261
'asyncify_minimal_runtime': (['-sMINIMAL_RUNTIME', '-sASYNCIFY=1'],),
32563262
'jspi': (['-sASYNCIFY=2', '-Wno-experimental'],),
32573263
'jspi_wasm_bigint': (['-sASYNCIFY=2', '-sWASM_BIGINT', '-Wno-experimental'],),
32583264
'jspi_wasm_bigint_minimal_runtime': (['-sMINIMAL_RUNTIME', '-sASYNCIFY=2', '-sWASM_BIGINT', '-Wno-experimental'],),
32593265
})
3260-
def test_async(self, args):
3266+
def test_async(self, opt, args):
32613267
if is_jspi(args) and not is_chrome():
32623268
self.skipTest(f'Current browser ({common.EMTEST_BROWSER}) does not support JSPI. Only chromium-based browsers ({CHROMIUM_BASED_BROWSERS}) support JSPI today.')
32633269

3264-
for opts in (0, 1, 2, 3):
3265-
print(opts)
3266-
self.btest_exit('test_async.c', cflags=['-O' + str(opts), '-g2'] + args)
3270+
self.btest_exit('test_async.c', cflags=[opt, '-g2'] + args)
32673271

32683272
def test_asyncify_tricky_function_sig(self):
32693273
self.btest('test_asyncify_tricky_function_sig.cpp', '85', cflags=['-sASYNCIFY_ONLY=[foo(char.const*?.int#),foo2(),main,__original_main]', '-sASYNCIFY'])

0 commit comments

Comments
 (0)