Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
8b5fc8b5
Commit
8b5fc8b5
authored
Jun 19, 2016
by
Ivan Smirnov
Browse files
Dump test output if the test runner fails
parent
42ad3284
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
example/run_test.py
example/run_test.py
+5
-6
No files found.
example/run_test.py
View file @
8b5fc8b5
...
...
@@ -46,12 +46,11 @@ name = sys.argv[1]
try
:
output_bytes
=
subprocess
.
check_output
([
sys
.
executable
,
"-u"
,
name
+
".py"
],
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
e
:
if
e
.
returncode
==
99
:
print
(
'Test "%s" could not be run.'
%
name
)
exit
(
0
)
else
:
raise
except
subprocess
.
CalledProcessError
as
exc
:
print
(
'Test `{}` failed:
\n
{}
\n
'
.
format
(
name
,
'-'
*
50
))
print
(
exc
.
output
.
decode
())
print
(
'-'
*
50
)
sys
.
exit
(
1
)
output
=
sanitize
(
output_bytes
.
decode
(
'utf-8'
))
reference
=
sanitize
(
open
(
name
+
'.ref'
,
'r'
).
read
())
...
...
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