diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-23 08:25:54 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-23 08:25:54 -0800 |
commit | 16eda852f5eb7efcccab571fba6090687ba34dee (patch) | |
tree | ad5fc5b7455733fea3662f7a0843e3c6e24ebc5e /tests | |
parent | fc56ff9c04938a89408a19d543d49d52a2e74af5 (diff) | |
parent | 472c9d327109a4ab32c6de9a3876cddba664c5d5 (diff) |
Merge pull request #717 from juj/test_compile_fail
Ensure that a failing compilation results in a nonzero return code.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 30e0e9c8..f3289e46 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7448,9 +7448,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]) |