Skip to content

Commit

Permalink
Add test case for the failing scenario where file is loaded from a re…
Browse files Browse the repository at this point in the history
…lative path.
  • Loading branch information
juj committed Oct 12, 2017
1 parent 287b507 commit 4965b25
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -7927,3 +7927,10 @@ def test_include_system_header_in_c(self):
print inc
open('a.c', 'w').write(inc)
subprocess.check_call([PYTHON, EMCC, '-std=c89', 'a.c'])

# Tests that Emscripten-compiled applications can be run from a relative path with node command line that is different than the current working directory.
def test_node_js_run_from_different_directory(self):
os.mkdir('subdir')
Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-o', os.path.join('subdir', 'a.js'), '-O3']).communicate()
ret = Popen(NODE_JS + [os.path.join('subdir', 'a.js')], stdout=PIPE).communicate()[0]
assert 'hello, world!' in ret

0 comments on commit 4965b25

Please sign in to comment.