aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-11-23 16:38:47 +0100
committerAlon Zakai <alonzakai@gmail.com>2012-11-23 16:38:47 +0100
commitfc56ff9c04938a89408a19d543d49d52a2e74af5 (patch)
treea48c26692d303a6aff785998498b668cfe9e56b4 /tests
parentef56626b6c721550dba2690dadbe05c645efa69d (diff)
fix test_failure_error_code
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 09fd7d49..30e0e9c8 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7711,14 +7711,9 @@ f.close()
shutil.rmtree(tempdirname)
def test_failure_error_code(self):
+ for compiler in [EMCC, EMXX]:
# Test that if one file is missing from the build, then emcc shouldn't succeed, and shouldn't try to produce an output file.
- process = Popen(['python', EMCC, path_from_root('tests', 'hello_world.c'), 'this_file_is_missing.c', '-o', 'this_output_file_should_never_exist.js'], stdout=PIPE, stderr=PIPE)
- process.communicate()
- assert process.returncode is not 0, 'Trying to compile a nonexisting file should return with a nonzero error code!'
- assert os.path.exists('this_output_file_should_never_exist.js') == False, 'Emcc should not produce an output file when build fails!'
-
- # Same goes for em++
- process = Popen(['python', EMXX, path_from_root('tests', 'hello_world.cpp'), 'this_file_is_missing.cpp', '-o', 'this_output_file_should_never_exist.js'], stdout=PIPE, stderr=PIPE)
+ process = Popen(['python', compiler, path_from_root('tests', 'hello_world.c'), 'this_file_is_missing.c', '-o', 'this_output_file_should_never_exist.js'], stdout=PIPE, stderr=PIPE)
process.communicate()
assert process.returncode is not 0, 'Trying to compile a nonexisting file should return with a nonzero error code!'
assert os.path.exists('this_output_file_should_never_exist.js') == False, 'Emcc should not produce an output file when build fails!'