Skip to content

Commit 8d3ec81

Browse files
authored
Rename browser test parameter args -> emcc_args. NFC (#23862)
This is for consistency with the non-browser tests where `args` means program arguments and `emcc_args` means compiler arguments.
1 parent 6521d7e commit 8d3ec81

File tree

4 files changed

+644
-644
lines changed

4 files changed

+644
-644
lines changed

test/common.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,25 +2366,25 @@ def run_browser(self, html_file, expected=None, message=None, timeout=None, extr
23662366
time.sleep(5)
23672367
print('(moving on..)')
23682368

2369-
def compile_btest(self, filename, args, reporting=Reporting.FULL):
2369+
def compile_btest(self, filename, emcc_args, reporting=Reporting.FULL):
23702370
# Inject support code for reporting results. This adds an include a header so testcases can
23712371
# use REPORT_RESULT, and also adds a cpp file to be compiled alongside the testcase, which
23722372
# contains the implementation of REPORT_RESULT (we can't just include that implementation in
23732373
# the header as there may be multiple files being compiled here).
23742374
if reporting != Reporting.NONE:
23752375
# For basic reporting we inject JS helper funtions to report result back to server.
2376-
args += ['--pre-js', test_file('browser_reporting.js')]
2376+
emcc_args += ['--pre-js', test_file('browser_reporting.js')]
23772377
if reporting == Reporting.FULL:
23782378
# If C reporting (i.e. the REPORT_RESULT macro) is required we
23792379
# also include report_result.c and force-include report_result.h
23802380
self.run_process([EMCC, '-c', '-I' + TEST_ROOT,
2381-
test_file('report_result.c')] + self.get_emcc_args(compile_only=True) + (['-fPIC'] if '-fPIC' in args else []))
2382-
args += ['report_result.o', '-include', test_file('report_result.h')]
2381+
test_file('report_result.c')] + self.get_emcc_args(compile_only=True) + (['-fPIC'] if '-fPIC' in emcc_args else []))
2382+
emcc_args += ['report_result.o', '-include', test_file('report_result.h')]
23832383
if EMTEST_BROWSER == 'node':
2384-
args.append('-DEMTEST_NODE')
2384+
emcc_args.append('-DEMTEST_NODE')
23852385
if not os.path.exists(filename):
23862386
filename = test_file(filename)
2387-
self.run_process([compiler_for(filename), filename] + self.get_emcc_args() + args)
2387+
self.run_process([compiler_for(filename), filename] + self.get_emcc_args() + emcc_args)
23882388

23892389
def btest_exit(self, filename, assert_returncode=0, *args, **kwargs):
23902390
"""Special case of `btest` that reports its result solely via exiting
@@ -2402,20 +2402,20 @@ def btest_exit(self, filename, assert_returncode=0, *args, **kwargs):
24022402

24032403
def btest(self, filename, expected=None,
24042404
post_build=None,
2405-
args=None, url_suffix='', timeout=None,
2405+
emcc_args=None, url_suffix='', timeout=None,
24062406
extra_tries=1,
24072407
reporting=Reporting.FULL,
24082408
output_basename='test'):
24092409
assert expected, 'a btest must have an expected output'
2410-
if args is None:
2411-
args = []
2412-
args = args.copy()
2410+
if emcc_args is None:
2411+
emcc_args = []
2412+
emcc_args = emcc_args.copy()
24132413
filename = find_browser_test_file(filename)
24142414
outfile = output_basename + '.html'
2415-
args += ['-o', outfile]
2416-
# print('all args:', args)
2415+
emcc_args += ['-o', outfile]
2416+
# print('all args:', emcc_args)
24172417
utils.delete_file(outfile)
2418-
self.compile_btest(filename, args, reporting=reporting)
2418+
self.compile_btest(filename, emcc_args, reporting=reporting)
24192419
self.assertExists(outfile)
24202420
if post_build:
24212421
post_build()

0 commit comments

Comments
 (0)