Skip to content

Commit b04fd51

Browse files
committed
Add a previously failed test case
This failed with: ``` Aborted(Assertion failed: scriptDirectory (./) should be an absolute path) ```
1 parent 3e47701 commit b04fd51

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/test_other.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12781,3 +12781,16 @@ def test_signext_lowering(self):
1278112781
# should successfully lower sign-ext.
1278212782
self.run_process(cmd + ['-sMIN_SAFARI_VERSION=120000', '-o', 'lowered.js'])
1278312783
self.assertEqual('1\n', self.run_js('lowered.js'))
12784+
12785+
def test_locate_file_abspath_pthread(self):
12786+
# Verify that `scriptDirectory` is an absolute path when `ENVIRONMENT_IS_WORKER`
12787+
self.emcc_args += ['-pthread', '--pre-js', 'pre.js']
12788+
self.set_setting('PROXY_TO_PTHREAD')
12789+
self.set_setting('EXIT_RUNTIME')
12790+
create_file('pre.js', '''
12791+
Module['locateFile'] = (fileName, scriptDirectory) => {
12792+
assert(nodePath['isAbsolute'](scriptDirectory), `scriptDirectory (${scriptDirectory}) should be an absolute path`);
12793+
return scriptDirectory + fileName;
12794+
};
12795+
''')
12796+
self.do_runf(test_file('hello_world.c'), 'hello, world!')

0 commit comments

Comments
 (0)