Skip to content

Commit 84e9bb1

Browse files
authored
test: Fix test_demangle_stacks_symbol_map and run it under spidermonkey in CI. NFC (#19708)
1 parent c14a2d0 commit 84e9bb1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,10 +620,10 @@ jobs:
620620
export PATH="`pwd`/node-v18.12.0-linux-x64/bin:${PATH}"
621621
npm install jsvu -g
622622
jsvu --os=default --engines=spidermonkey
623-
echo "JSC_ENGINE = [os.path.expanduser('~/.jsvu/bin/spidermonkey')]" >> ~/emsdk/.emscripten
624-
echo "JS_ENGINES = [JSC_ENGINE]" >> ~/emsdk/.emscripten
623+
echo "SPIDERMONKEY_ENGINE = [os.path.expanduser('~/.jsvu/bin/spidermonkey')]" >> ~/emsdk/.emscripten
624+
echo "JS_ENGINES = [SPIDERMONKEY_ENGINE]" >> ~/emsdk/.emscripten
625625
- run-tests:
626-
test_targets: "core0.test_hello_world"
626+
test_targets: "core0.test_hello_world core2.test_demangle_stacks_symbol_map"
627627
test-node-compat:
628628
# We don't use `bionic` here since its tool old to run recent node versions:
629629
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`

test/test_core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7436,14 +7436,15 @@ def test_demangle_stacks_symbol_map(self):
74367436
self.set_setting('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE', '$stackTrace')
74377437

74387438
self.set_setting('DEMANGLE_SUPPORT')
7439+
self.set_setting('ENVIRONMENT', 'node,shell')
74397440
if '-O' not in str(self.emcc_args) or '-O0' in self.emcc_args or '-O1' in self.emcc_args or '-g' in self.emcc_args:
74407441
self.skipTest("without opts, we don't emit a symbol map")
74417442
self.emcc_args += ['--emit-symbol-map']
74427443
self.do_runf(test_file('core/test_demangle_stacks.cpp'), 'Aborted', assert_returncode=NON_ZERO)
74437444
# make sure the shortened name is the right one
74447445
full_aborter = None
74457446
short_aborter = None
7446-
for line in open('test_demangle_stacks.js.symbols').readlines():
7447+
for line in read_file('test_demangle_stacks.js.symbols').splitlines():
74477448
if ':' not in line:
74487449
continue
74497450
# split by the first ':' (wasm backend demangling may include more :'s later on)
@@ -7454,7 +7455,7 @@ def test_demangle_stacks_symbol_map(self):
74547455
self.assertIsNotNone(full_aborter)
74557456
self.assertIsNotNone(short_aborter)
74567457
print('full:', full_aborter, 'short:', short_aborter)
7457-
if config.SPIDERMONKEY_ENGINE and os.path.exists(config.SPIDERMONKEY_ENGINE[0]):
7458+
if config.SPIDERMONKEY_ENGINE:
74587459
output = self.run_js('test_demangle_stacks.js', engine=config.SPIDERMONKEY_ENGINE, assert_returncode=NON_ZERO)
74597460
# we may see the full one, if -g, or the short one if not
74607461
if ' ' + short_aborter + ' ' not in output and ' ' + full_aborter + ' ' not in output:

0 commit comments

Comments
 (0)