Skip to content

Commit 6afe133

Browse files
committed
Add test case for the failing scenario where file is loaded from a relative path.
1 parent 22b5611 commit 6afe133

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_other.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7927,3 +7927,10 @@ def test_include_system_header_in_c(self):
79277927
print inc
79287928
open('a.c', 'w').write(inc)
79297929
subprocess.check_call([PYTHON, EMCC, '-std=c89', 'a.c'])
7930+
7931+
# Tests that Emscripten-compiled applications can be run from a relative path with node command line that is different than the current working directory.
7932+
def test_node_js_run_from_different_directory(self):
7933+
os.mkdir('subdir')
7934+
Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-o', os.path.join('subdir', 'a.js'), '-O3']).communicate()
7935+
ret = Popen(NODE_JS + [os.path.join('subdir', 'a.js')], stdout=PIPE).communicate()[0]
7936+
assert 'hello, world!' in ret

0 commit comments

Comments
 (0)