mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-04-05 10:36:16 +02:00
test both StyledWriter and StyledStreamWriter
This commit is contained in:
parent
ac6bbbc739
commit
70704b9a70
@ -58,7 +58,8 @@ def safeReadFile( path ):
|
|||||||
return '<File "%s" is missing: %s>' % (path,e)
|
return '<File "%s" is missing: %s>' % (path,e)
|
||||||
|
|
||||||
def runAllTests( jsontest_executable_path, input_dir = None,
|
def runAllTests( jsontest_executable_path, input_dir = None,
|
||||||
use_valgrind=False, with_json_checker=False ):
|
use_valgrind=False, with_json_checker=False,
|
||||||
|
writerClass='StyledWriter'):
|
||||||
if not input_dir:
|
if not input_dir:
|
||||||
input_dir = os.path.join( os.getcwd(), 'data' )
|
input_dir = os.path.join( os.getcwd(), 'data' )
|
||||||
tests = glob( os.path.join( input_dir, '*.json' ) )
|
tests = glob( os.path.join( input_dir, '*.json' ) )
|
||||||
@ -73,7 +74,7 @@ def runAllTests( jsontest_executable_path, input_dir = None,
|
|||||||
is_json_checker_test = (input_path in test_jsonchecker) or expect_failure
|
is_json_checker_test = (input_path in test_jsonchecker) or expect_failure
|
||||||
print('TESTING:', input_path, end=' ')
|
print('TESTING:', input_path, end=' ')
|
||||||
options = is_json_checker_test and '--json-checker' or ''
|
options = is_json_checker_test and '--json-checker' or ''
|
||||||
options += ' --json-writer StyledWriter'
|
options += ' --json-writer %s'%writerClass
|
||||||
cmd = '%s%s %s "%s"' % (
|
cmd = '%s%s %s "%s"' % (
|
||||||
valgrind_path, jsontest_executable_path, options,
|
valgrind_path, jsontest_executable_path, options,
|
||||||
input_path)
|
input_path)
|
||||||
@ -147,7 +148,15 @@ def main():
|
|||||||
else:
|
else:
|
||||||
input_path = None
|
input_path = None
|
||||||
status = runAllTests( jsontest_executable_path, input_path,
|
status = runAllTests( jsontest_executable_path, input_path,
|
||||||
use_valgrind=options.valgrind, with_json_checker=options.with_json_checker )
|
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,
|
||||||
|
use_valgrind=options.valgrind,
|
||||||
|
with_json_checker=options.with_json_checker,
|
||||||
|
writerClass='StyledStreamWriter')
|
||||||
sys.exit( status )
|
sys.exit( status )
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user