Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
1fe59010
Commit
1fe59010
authored
Jun 01, 2016
by
Dean Moldovan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a more informative diff output for failed tests
parent
4337a5d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
example/run_test.py
+6
-5
No files found.
example/run_test.py
View file @
1fe59010
...
...
@@ -2,6 +2,7 @@ import sys
import
os
import
re
import
subprocess
import
difflib
remove_unicode_marker
=
re
.
compile
(
r'u(\'[^\']*\')'
)
remove_long_marker
=
re
.
compile
(
r'([0-9])L'
)
...
...
@@ -36,11 +37,7 @@ def sanitize(lines):
line
=
""
lines
[
i
]
=
line
lines
=
'
\n
'
.
join
(
sorted
([
l
for
l
in
lines
if
l
!=
""
]))
print
(
'=================='
)
print
(
lines
)
return
lines
return
'
\n
'
.
join
(
sorted
([
l
for
l
in
lines
if
l
!=
""
]))
path
=
os
.
path
.
dirname
(
__file__
)
if
path
!=
''
:
...
...
@@ -69,4 +66,8 @@ elif output == reference:
exit
(
0
)
else
:
print
(
'Test "
%
s" FAILED!'
%
name
)
print
(
'--- output'
)
print
(
'+++ reference'
)
print
(
''
.
join
(
difflib
.
ndiff
(
output
.
splitlines
(
keepends
=
True
),
reference
.
splitlines
(
keepends
=
True
))))
exit
(
-
1
)
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