Skip to content

btest: add assert when manual_reference argument is mistakenly set. NFC #17458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ def btest_exit(self, filename, assert_returncode=0, *args, **kwargs):
return self.btest(filename, *args, **kwargs)

def btest(self, filename, expected=None, reference=None,
reference_slack=0, manual_reference=False, post_build=None,
reference_slack=0, manual_reference=None, post_build=None,
args=None, message='.', also_proxied=False,
url_suffix='', timeout=None, also_wasm2js=False,
manually_trigger_reftest=False, extra_tries=1,
Expand All @@ -1710,6 +1710,9 @@ def btest(self, filename, expected=None, reference=None,
self.reftest(test_file(reference), manually_trigger=manually_trigger_reftest)
if not manual_reference:
args += ['--pre-js', 'reftest.js', '-sGL_TESTING']
else:
# manual_reference only makes sense for reference tests
assert manual_reference is None
outfile = 'test.html'
args += [filename, '-o', outfile]
# print('all args:', args)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def post():
</body>''')
create_file('test.html', html)

self.btest('sdl_key_proxy.c', '223092870', args=['--proxy-to-worker', '--pre-js', 'pre.js', '-sEXPORTED_FUNCTIONS=_main,_one', '-lSDL', '-lGL'], manual_reference=True, post_build=post)
self.btest('sdl_key_proxy.c', '223092870', args=['--proxy-to-worker', '--pre-js', 'pre.js', '-sEXPORTED_FUNCTIONS=_main,_one', '-lSDL', '-lGL'], post_build=post)

def test_canvas_focus(self):
self.btest_exit('canvas_focus.c')
Expand Down Expand Up @@ -979,7 +979,7 @@ def post():

create_file('test.html', html)

self.btest('keydown_preventdefault_proxy.cpp', '300', args=['--proxy-to-worker', '-sEXPORTED_FUNCTIONS=_main'], manual_reference=True, post_build=post)
self.btest('keydown_preventdefault_proxy.cpp', '300', args=['--proxy-to-worker', '-sEXPORTED_FUNCTIONS=_main'], post_build=post)

def test_sdl_text(self):
create_file('pre.js', '''
Expand Down