Skip to content

Commit

Permalink
test both StyledWriter and StyledStreamWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
cdunn2001 committed Jan 23, 2015
1 parent ac6bbbc commit 70704b9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/runjsontests.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def safeReadFile( path ):
return '<File "%s" is missing: %s>' % (path,e)

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:
input_dir = os.path.join( os.getcwd(), 'data' )
tests = glob( os.path.join( input_dir, '*.json' ) )
Expand All @@ -73,7 +74,7 @@ def runAllTests( jsontest_executable_path, input_dir = None,
is_json_checker_test = (input_path in test_jsonchecker) or expect_failure
print('TESTING:', input_path, end=' ')
options = is_json_checker_test and '--json-checker' or ''
options += ' --json-writer StyledWriter'
options += ' --json-writer %s'%writerClass
cmd = '%s%s %s "%s"' % (
valgrind_path, jsontest_executable_path, options,
input_path)
Expand Down Expand Up @@ -147,7 +148,15 @@ def main():
else:
input_path = None
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 )

if __name__ == '__main__':
Expand Down

0 comments on commit 70704b9

Please sign in to comment.