Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4b739881
Commit
4b739881
authored
Mar 31, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regrtest.py checks that child process exit code is zero
parent
28346b80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Lib/test/regrtest.py
Lib/test/regrtest.py
+8
-0
No files found.
Lib/test/regrtest.py
View file @
4b739881
...
@@ -216,6 +216,7 @@ ENV_CHANGED = -1
...
@@ -216,6 +216,7 @@ ENV_CHANGED = -1
SKIPPED
=
-
2
SKIPPED
=
-
2
RESOURCE_DENIED
=
-
3
RESOURCE_DENIED
=
-
3
INTERRUPTED
=
-
4
INTERRUPTED
=
-
4
CHILD_ERROR
=
-
5
# error in a child process
from
test
import
support
from
test
import
support
...
@@ -579,10 +580,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
...
@@ -579,10 +580,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
universal_newlines=True,
universal_newlines=True,
close_fds=(os.name != 'nt'))
close_fds=(os.name != 'nt'))
stdout, stderr = popen.communicate()
stdout, stderr = popen.communicate()
retcode = popen.wait()
# Strip last refcount output line if it exists, since it
# Strip last refcount output line if it exists, since it
# comes from the shutdown of the interpreter in the subcommand.
# comes from the shutdown of the interpreter in the subcommand.
stderr = debug_output_pat.sub("", stderr)
stderr = debug_output_pat.sub("", stderr)
stdout, _, result = stdout.strip().rpartition("
\
n
")
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:
if not result:
output.put((None, None, None, None))
output.put((None, None, None, None))
return
return
...
@@ -612,6 +618,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
...
@@ -612,6 +618,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if result[0] == INTERRUPTED:
if result[0] == INTERRUPTED:
assert result[1] == 'KeyboardInterrupt'
assert result[1] == 'KeyboardInterrupt'
raise KeyboardInterrupt # What else?
raise KeyboardInterrupt # What else?
if result[0] == CHILD_ERROR:
raise Exception(result[1])
accumulate_result(test, result)
accumulate_result(test, result)
test_index += 1
test_index += 1
except KeyboardInterrupt:
except KeyboardInterrupt:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment