Skip to content

Commit ae9dc6a

Browse files
committed
Avoid space after -s when for command line settings. NFC
We still have a test for the form that does include the space but we want to encourage folks to use the one without the space. Its more concise, and less prone to issues such as the once where cmake re-orders link flags in some cases.
1 parent 3d86513 commit ae9dc6a

19 files changed

+1072
-1074
lines changed

tests/benchmark_sse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def run_benchmark(benchmark_file, results_file, build_args):
4646

4747
# Run emscripten build
4848
out_file = os.path.join(temp_dir, 'benchmark_sse_html.js')
49-
cmd = [EMCC, benchmark_file, '-O3', '-s', 'TOTAL_MEMORY=536870912', '-o', out_file] + build_args
49+
cmd = [EMCC, benchmark_file, '-O3', '-sTOTAL_MEMORY=536870912', '-o', out_file] + build_args
5050
print('Building Emscripten version of the benchmark:')
5151
print(' '.join(cmd))
5252
run_process(cmd)

tests/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ def _test_dylink_dso_needed(self, do_run):
958958
so = '.wasm' if self.is_wasm() else '.js'
959959

960960
def ccshared(src, linkto=[]):
961-
cmdv = [EMCC, src, '-o', shared.unsuffixed(src) + so, '-s', 'SIDE_MODULE'] + self.get_emcc_args()
961+
cmdv = [EMCC, src, '-o', shared.unsuffixed(src) + so, '-sSIDE_MODULE'] + self.get_emcc_args()
962962
cmdv += linkto
963963
self.run_process(cmdv)
964964

@@ -1537,7 +1537,7 @@ def compile_btest(self, args, reporting=Reporting.FULL):
15371537
# use REPORT_RESULT, and also adds a cpp file to be compiled alongside the testcase, which
15381538
# contains the implementation of REPORT_RESULT (we can't just include that implementation in
15391539
# the header as there may be multiple files being compiled here).
1540-
args += ['-s', 'IN_TEST_HARNESS']
1540+
args += ['-sIN_TEST_HARNESS']
15411541
if reporting != Reporting.NONE:
15421542
# For basic reporting we inject JS helper funtions to report result back to server.
15431543
args += ['-DEMTEST_PORT_NUMBER=%d' % self.port,
@@ -1584,7 +1584,7 @@ def btest(self, filename, expected=None, reference=None,
15841584
expected = [str(i) for i in range(0, reference_slack + 1)]
15851585
self.reftest(test_file(reference), manually_trigger=manually_trigger_reftest)
15861586
if not manual_reference:
1587-
args += ['--pre-js', 'reftest.js', '-s', 'GL_TESTING']
1587+
args += ['--pre-js', 'reftest.js', '-sGL_TESTING']
15881588
outfile = 'test.html'
15891589
args += [filename, '-o', outfile]
15901590
# print('all args:', args)
@@ -1607,7 +1607,7 @@ def btest(self, filename, expected=None, reference=None,
16071607
if 'WASM=0' not in original_args and (also_wasm2js or self.also_wasm2js):
16081608
print('WASM=0')
16091609
self.btest(filename, expected, reference, reference_slack, manual_reference, post_build,
1610-
original_args + ['-s', 'WASM=0'], message, also_proxied=False, timeout=timeout)
1610+
original_args + ['-sWASM=0'], message, also_proxied=False, timeout=timeout)
16111611

16121612
if also_proxied:
16131613
print('proxied...')
@@ -1618,7 +1618,7 @@ def btest(self, filename, expected=None, reference=None,
16181618
post_build = self.post_manual_reftest
16191619
# run proxied
16201620
self.btest(filename, expected, reference, reference_slack, manual_reference, post_build,
1621-
original_args + ['--proxy-to-worker', '-s', 'GL_TESTING'], message, timeout=timeout)
1621+
original_args + ['--proxy-to-worker', '-sGL_TESTING'], message, timeout=timeout)
16221622

16231623

16241624
###################################################################################################

tests/test_benchmark.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ def build(self, parent, filename, args, shared_args, emcc_args, native_args, nat
203203
cmd = [
204204
EMCC, filename,
205205
OPTIMIZATIONS,
206-
'-s', 'INITIAL_MEMORY=256MB',
207-
'-s', 'ENVIRONMENT=node,shell',
208-
'-s', 'BENCHMARK=%d' % (1 if IGNORE_COMPILATION and not has_output_parser else 0),
206+
'-sINITIAL_MEMORY=256MB',
207+
'-sENVIRONMENT=node,shell',
208+
'-sBENCHMARK=%d' % (1 if IGNORE_COMPILATION and not has_output_parser else 0),
209209
'-o', final
210210
] + shared_args + LLVM_FEATURE_FLAGS
211211
if common.EMTEST_FORCE64:
@@ -216,7 +216,7 @@ def build(self, parent, filename, args, shared_args, emcc_args, native_args, nat
216216
# above, such as minimal runtime
217217
cmd += emcc_args + self.extra_args
218218
if 'FORCE_FILESYSTEM' not in cmd:
219-
cmd += ['-s', 'FILESYSTEM=0']
219+
cmd += ['-sFILESYSTEM=0']
220220
if PROFILING:
221221
cmd += ['--profiling-funcs']
222222
self.cmd = cmd
@@ -253,9 +253,9 @@ def build(self, parent, filename, args, shared_args, emcc_args, native_args, nat
253253
# wasm2c doesn't want minimal runtime which the normal emscripten
254254
# benchmarker defaults to, as we don't have any JS anyhow
255255
emcc_args = emcc_args + [
256-
'-s', 'STANDALONE_WASM',
257-
'-s', 'MINIMAL_RUNTIME=0',
258-
'-s', 'WASM2C'
256+
'-sSTANDALONE_WASM',
257+
'-sMINIMAL_RUNTIME=0',
258+
'-sWASM2C'
259259
]
260260

261261
global LLVM_FEATURE_FLAGS
@@ -970,7 +970,7 @@ def lib_builder(name, native, env_init):
970970

971971
self.do_benchmark('lua_' + benchmark, '', expected,
972972
force_c=True, args=[benchmark + '.lua', DEFAULT_ARG],
973-
emcc_args=['--embed-file', benchmark + '.lua', '-s', 'FORCE_FILESYSTEM', '-s', 'MINIMAL_RUNTIME=0'], # not minimal because of files
973+
emcc_args=['--embed-file', benchmark + '.lua', '-sFORCE_FILESYSTEM', '-sMINIMAL_RUNTIME=0'], # not minimal because of files
974974
lib_builder=lib_builder, native_exec=os.path.join('building', 'third_party', 'lua_native', 'src', 'lua'),
975975
output_parser=output_parser, args_processor=args_processor)
976976

@@ -1047,7 +1047,7 @@ def lib_builder(name, native, env_init):
10471047
def test_zzz_sqlite(self):
10481048
src = read_file(test_file('third_party/sqlite/sqlite3.c')) + read_file(test_file('sqlite/speedtest1.c'))
10491049
self.do_benchmark('sqlite', src, 'TOTAL...', native_args=['-ldl', '-pthread'], shared_args=['-I' + test_file('third_party', 'sqlite')],
1050-
emcc_args=['-s', 'FILESYSTEM', '-s', 'MINIMAL_RUNTIME=0'], # not minimal because of files
1050+
emcc_args=['-sFILESYSTEM', '-sMINIMAL_RUNTIME=0'], # not minimal because of files
10511051
force_c=True)
10521052

10531053
def test_zzz_poppler(self):
@@ -1096,7 +1096,7 @@ def lib_builder(name, native, env_init):
10961096
# TODO: Fix poppler native build and remove skip_native=True
10971097
self.do_benchmark('poppler', '', 'hashed printout',
10981098
shared_args=['-I' + test_file('poppler', 'include'), '-I' + test_file('freetype', 'include')],
1099-
emcc_args=['-s', 'FILESYSTEM', '--pre-js', 'pre.js', '--embed-file',
1100-
test_file('poppler', 'emscripten_html5.pdf') + '@input.pdf', '-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0',
1101-
'-s', 'MINIMAL_RUNTIME=0'], # not minimal because of files
1099+
emcc_args=['-sFILESYSTEM', '--pre-js', 'pre.js', '--embed-file',
1100+
test_file('poppler', 'emscripten_html5.pdf') + '@input.pdf', '-sERROR_ON_UNDEFINED_SYMBOLS=0',
1101+
'-sMINIMAL_RUNTIME=0'], # not minimal because of files
11021102
lib_builder=lib_builder, skip_native=True)

0 commit comments

Comments
 (0)