Skip to content

Commit d753f50

Browse files
committed
Add test case for the failing scenario where file is loaded from a relative path.
1 parent c0f4dfc commit d753f50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_other.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8139,3 +8139,11 @@ def test_toolchain_profiler(self):
81398139
environ['EM_PROFILE_TOOLCHAIN'] = '1'
81408140
# replaced subprocess functions should not cause errors
81418141
run_process([PYTHON, EMCC, path_from_root('tests', 'hello_world.c')], env=environ)
8142+
8143+
# Tests that Emscripten-compiled applications can be run from a relative path with node command line that is different than the current working directory.
8144+
def test_node_js_run_from_different_directory(self):
8145+
os.mkdir('subdir')
8146+
Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-o', os.path.join('subdir', 'a.js'), '-O3']).communicate()
8147+
ret = Popen(NODE_JS + [os.path.join('subdir', 'a.js')], stdout=PIPE).communicate()[0]
8148+
assert 'hello, world!' in ret
8149+

0 commit comments

Comments
 (0)