Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
3rd
jsoncpp2
Commits
411d88fa
Commit
411d88fa
authored
5 years ago
by
Christopher Dunn
Browse files
Options
Download
Email Patches
Plain Diff
Stop checking status; raise instead
parent
1ff6bb65
master
00.11.z
BillyDonahue-avoid-isprint
archersim/1.9.5
hwcd/bugfix
jsoncpp_version
pypi
1.9.5
1.9.4
1.9.3
00.11.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/runjsontests.py
+12
-12
test/runjsontests.py
with
12 additions
and
12 deletions
+12
-12
test/runjsontests.py
View file @
411d88fa
...
...
@@ -62,6 +62,10 @@ def safeReadFile(path):
except
IOError
as
e
:
return
'<File "%s" is missing: %s>'
%
(
path
,
e
)
class
FailError
(
Exception
):
def
__init__
(
self
,
msg
):
super
(
Exception
,
self
).
__init__
(
msg
)
def
runAllTests
(
jsontest_executable_path
,
input_dir
=
None
,
use_valgrind
=
False
,
with_json_checker
=
False
,
writerClass
=
'StyledWriter'
):
...
...
@@ -161,10 +165,9 @@ def runAllTests(jsontest_executable_path, input_dir = None,
print
()
print
(
'Test results: %d passed, %d failed.'
%
(
len
(
tests
)
-
len
(
failed_tests
),
len
(
failed_tests
)))
r
eturn
1
r
aise
FailError
(
repr
(
failed_tests
))
else
:
print
(
'All %d tests passed.'
%
len
(
tests
))
return
0
def
main
():
from
optparse
import
OptionParser
...
...
@@ -187,24 +190,21 @@ def main():
input_path
=
os
.
path
.
normpath
(
os
.
path
.
abspath
(
args
[
1
]))
else
:
input_path
=
None
status
=
runAllTests
(
jsontest_executable_path
,
input_path
,
runAllTests
(
jsontest_executable_path
,
input_path
,
use_valgrind
=
options
.
valgrind
,
with_json_checker
=
options
.
with_json_checker
,
writerClass
=
'StyledWriter'
)
if
status
:
sys
.
exit
(
status
)
status
=
runAllTests
(
jsontest_executable_path
,
input_path
,
runAllTests
(
jsontest_executable_path
,
input_path
,
use_valgrind
=
options
.
valgrind
,
with_json_checker
=
options
.
with_json_checker
,
writerClass
=
'StyledStreamWriter'
)
if
status
:
sys
.
exit
(
status
)
status
=
runAllTests
(
jsontest_executable_path
,
input_path
,
runAllTests
(
jsontest_executable_path
,
input_path
,
use_valgrind
=
options
.
valgrind
,
with_json_checker
=
options
.
with_json_checker
,
writerClass
=
'BuiltStyledStreamWriter'
)
if
status
:
sys
.
exit
(
status
)
if
__name__
==
'__main__'
:
main
()
try
:
main
()
except
FailError
:
sys
.
exit
(
1
)
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help