diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-06 17:25:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-06 17:25:09 -0700 |
commit | 0266e05582042f69de08b966a7e63c6828ba25d4 (patch) | |
tree | 29aa8d9a1ae9b14feda5fb20b03f76c038a81f19 /tests/runner.py | |
parent | 3ef0364bbda11df569a8e11254138c6b0b7b17c6 (diff) |
restore support for noInitialRun
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 76fa7a8a..7479aaf0 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6482,6 +6482,13 @@ f.close() open(os.path.join(self.get_dir(), 'a.out.js'), 'w').write(src) self.assertNotContained('pre-run\nhello from main\npost-run\n', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + # noInitialRun prevents run + for no_initial_run in [0, 1]: + Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp')]).communicate() + src = 'var Module = { noInitialRun: %d };\n' % no_initial_run + open(os.path.join(self.get_dir(), 'a.out.js')).read(); + open(os.path.join(self.get_dir(), 'a.out.js'), 'w').write(src) + assert ('hello from main' in run_js(os.path.join(self.get_dir(), 'a.out.js'))) != no_initial_run, 'only run if no noInitialRun' + def test_eliminator(self): input = open(path_from_root('tools', 'eliminator', 'eliminator-test.js')).read() expected = open(path_from_root('tools', 'eliminator', 'eliminator-test-output.js')).read() |