Skip to content

Commit 5da5234

Browse files
committed
Refactor test to use do_runf and remove .out file
1 parent d9f7289 commit 5da5234

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

test/jslib/test_jslib_custom_settings.out

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/test_jslib.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,15 @@ def test_jslib_legacy(self):
353353
# the -jsDfoo=val syntax:
354354
# See https://github.com/emscripten-core/emscripten/issues/10580.
355355
def test_jslib_custom_settings(self):
356-
self.cflags += ['--js-library', test_file('jslib/test_jslib_custom_settings.js'), '-jsDCUSTOM_JS_OPTION=1']
357-
self.do_run_in_out_file_test('jslib/test_jslib_custom_settings.c')
358-
359-
self.run_process([EMCC, test_file('hello_world.c'), '-jsDCUSTOM_JS_OPTION=1', '-jsDCUSTOM_JS_OPTION=2'])
356+
self.cflags += ['--js-library', test_file('jslib/test_jslib_custom_settings.js')]
360357

361358
self.assert_fail([EMCC, '-jsDWASM=0'], 'cannot change built-in settings values with a -jsD directive')
362359

360+
self.do_runf('jslib/test_jslib_custom_settings.c', '1\n', cflags=['-jsDCUSTOM_JS_OPTION=1'])
361+
362+
# verify that the settings can be specified more than once, and that the last one wins.
363+
self.do_runf('jslib/test_jslib_custom_settings.c', '2\n', cflags=['-jsDCUSTOM_JS_OPTION=1', '-jsDCUSTOM_JS_OPTION=2'])
364+
363365
def test_jslib_native_deps(self):
364366
# Verify that memset (which lives in compiled code), can be specified as a JS library
365367
# dependency.

0 commit comments

Comments
 (0)