aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-12-14 01:18:36 +0200
committerJukka Jylänki <jujjyl@gmail.com>2013-12-14 01:19:24 +0200
commit69317b35549ae38cf99c4c896d556803d58174cc (patch)
treee0e78cb46a913008e39c738f1a02f68f3713801f /tests
parent9906e87b1b5489fc7a14d335a4c13d77da18d4db (diff)
Implemented --emrun linker flag to emcc, which is a helper that makes the compilation output emrun-compatible.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_browser.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_browser.py b/tests/test_browser.py
index a2d49c4f..55bab05b 100644
--- a/tests/test_browser.py
+++ b/tests/test_browser.py
@@ -1691,8 +1691,13 @@ keydown(100);keyup(100); // trigger the end
assert 'Traceback' not in result
def test_emrun(self):
- Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_exit.c'), '--post-js', path_from_root('src', 'emrun_postjs.js'), '-o', 'hello_world.html']).communicate()
- process = subprocess.Popen([PYTHON, path_from_root('emrun'), '--timeout', '30', 'hello_world.html'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_exit.c'), '--emrun', '-o', 'hello_world.html']).communicate()
+ outdir = os.getcwd()
+ # We cannot run emrun from the temp directory the suite will clean up afterwards, since the browser that is launched will have that directory as startup directory,
+ # and the browser will not close as part of the test, pinning down the cwd on Windows and it wouldn't be possible to delete it. Therefore switch away from that directory
+ # before launching.
+ os.chdir(path_from_root())
+ process = subprocess.Popen([PYTHON, path_from_root('emrun'), '--timeout', '30', '--verbose', os.path.join(outdir, 'hello_world.html')], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdout, stderr) = process.communicate()
assert process.returncode == 100
assert 'hello, world!' in stdout