Skip to content

Commit

Permalink
[test] Remove also_wasm2js btest argument. NFC (#21232)
Browse files Browse the repository at this point in the history
This only have one user, and we have a cleaner mechanism for doing
this these days in terms of the decorator.
  • Loading branch information
sbc100 committed Feb 1, 2024
1 parent a9ebfb7 commit 013f742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
10 changes: 1 addition & 9 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,6 @@ def browser_open(cls, url):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.also_wasm2js = int(os.getenv('EMTEST_BROWSER_ALSO_WASM2JS', '0')) == 1
cls.port = int(os.getenv('EMTEST_BROWSER_PORT', '8888'))
if not has_browser() or EMTEST_BROWSER == 'node':
return
Expand Down Expand Up @@ -2156,7 +2155,7 @@ def btest_exit(self, filename, assert_returncode=0, *args, **kwargs):
def btest(self, filename, expected=None, reference=None,
reference_slack=0, manual_reference=None, post_build=None,
args=None, also_proxied=False,
url_suffix='', timeout=None, also_wasm2js=False,
url_suffix='', timeout=None,
manually_trigger_reftest=False, extra_tries=1,
reporting=Reporting.FULL,
output_basename='test'):
Expand Down Expand Up @@ -2197,13 +2196,6 @@ def btest(self, filename, expected=None, reference=None,
else:
self.run_browser(outfile + url_suffix, expected=['/report_result?' + e for e in expected], timeout=timeout, extra_tries=extra_tries)

# Tests can opt into being run under wasmj2s as well
# Ignore this under MEMORY64 where wasm2js is not yet supported.
if 'WASM=0' not in original_args and (also_wasm2js or self.also_wasm2js) and not self.is_wasm64():
print('WASM=0')
self.btest(filename, expected, reference, reference_slack, manual_reference, post_build,
original_args + ['-sWASM=0'], also_proxied=False, timeout=timeout)

if also_proxied:
print('proxied...')
if reference:
Expand Down
10 changes: 5 additions & 5 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ def decorated(self, *args, **kwargs):
def also_with_wasm2js(f):
assert callable(f)

def metafunc(self, with_wasm2js):
def metafunc(self, with_wasm2js, *args, **kwargs):
assert self.get_setting('WASM') is None
if with_wasm2js:
self.require_wasm2js()
self.set_setting('WASM', 0)
f(self)
f(self, *args, **kwargs)
else:
f(self)
f(self, *args, **kwargs)

metafunc._parameterize = {'': (False,),
'wasm2js': (True,)}
Expand Down Expand Up @@ -4838,11 +4838,11 @@ def test_fetch_to_memory(self):
})
@no_firefox('https://github.com/emscripten-core/emscripten/issues/16868')
@requires_threads
@also_with_wasm2js
def test_fetch_from_thread(self, args):
shutil.copyfile(test_file('gears.png'), 'gears.png')
self.btest_exit('fetch/test_fetch_from_thread.cpp',
args=args + ['-pthread', '-sPROXY_TO_PTHREAD', '-sFETCH_DEBUG', '-sFETCH', '-DFILE_DOES_NOT_EXIST'],
also_wasm2js=True)
args=args + ['-pthread', '-sPROXY_TO_PTHREAD', '-sFETCH_DEBUG', '-sFETCH', '-DFILE_DOES_NOT_EXIST'])

@also_with_wasm2js
def test_fetch_to_indexdb(self):
Expand Down

0 comments on commit 013f742

Please sign in to comment.