aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2012-11-16 18:42:01 +0200
committerJukka Jylänki <jujjyl@gmail.com>2012-11-16 18:42:29 +0200
commit472c9d327109a4ab32c6de9a3876cddba664c5d5 (patch)
tree0fb52d98fefc3cfaa62119bed0b62719059aee24 /tests
parent9b846744151a4d628d76cbf2cb5c0b385bc9300d (diff)
Ensure that a failing compilation results in a nonzero return code.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 0baf79dc..4a8cfe2f 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7331,9 +7331,11 @@ Options that are modified or new in %s include:
# properly report source code errors, and stop there
self.clear()
assert not os.path.exists('a.out.js')
- output = Popen(['python', compiler, path_from_root('tests', 'hello_world_error' + suffix)], stdout=PIPE, stderr=PIPE).communicate()
+ process = Popen(['python', compiler, path_from_root('tests', 'hello_world_error' + suffix)], stdout=PIPE, stderr=PIPE)
+ output = process.communicate()
assert not os.path.exists('a.out.js'), 'compilation failed, so no output file is expected'
assert len(output[0]) == 0, output[0]
+ assert process.returncode is not 0, 'Failed compilation must return a nonzero error code!'
self.assertNotContained('IOError', output[1]) # no python stack
self.assertNotContained('Traceback', output[1]) # no python stack
self.assertContained('error: invalid preprocessing directive', output[1])