diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-31 16:02:36 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-31 16:02:36 (GMT) |
commit | 4b739881227b902c78599c887ba4cb3414820d1a (patch) | |
tree | 63c659750de8dc94f83b0487366a158c2d0c7e50 /Lib/test/regrtest.py | |
parent | 28346b8077ca89b8ad4eec2a51ab626ce646b7ed (diff) | |
download | cpython-4b739881227b902c78599c887ba4cb3414820d1a.zip cpython-4b739881227b902c78599c887ba4cb3414820d1a.tar.gz cpython-4b739881227b902c78599c887ba4cb3414820d1a.tar.bz2 |
regrtest.py checks that child process exit code is zero
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index c3aff26..19380be 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -216,6 +216,7 @@ ENV_CHANGED = -1 SKIPPED = -2 RESOURCE_DENIED = -3 INTERRUPTED = -4 +CHILD_ERROR = -5 # error in a child process from test import support @@ -579,10 +580,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, universal_newlines=True, close_fds=(os.name != 'nt')) stdout, stderr = popen.communicate() + retcode = popen.wait() # Strip last refcount output line if it exists, since it # comes from the shutdown of the interpreter in the subcommand. stderr = debug_output_pat.sub("", stderr) stdout, _, result = stdout.strip().rpartition("\n") + if retcode != 0: + result = (CHILD_ERROR, "Exit code %s" % retcode) + output.put((test, stdout.rstrip(), stderr.rstrip(), result)) + return if not result: output.put((None, None, None, None)) return @@ -612,6 +618,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, if result[0] == INTERRUPTED: assert result[1] == 'KeyboardInterrupt' raise KeyboardInterrupt # What else? + if result[0] == CHILD_ERROR: + raise Exception(result[1]) accumulate_result(test, result) test_index += 1 except KeyboardInterrupt: |