@@ -58,7 +58,8 @@ def safeReadFile( path ):
5858 return '<File "%s" is missing: %s>' % (path ,e )
5959
6060def runAllTests ( jsontest_executable_path , input_dir = None ,
61- use_valgrind = False , with_json_checker = False ):
61+ use_valgrind = False , with_json_checker = False ,
62+ writerClass = 'StyledWriter' ):
6263 if not input_dir :
6364 input_dir = os .path .join ( os .getcwd (), 'data' )
6465 tests = glob ( os .path .join ( input_dir , '*.json' ) )
@@ -73,7 +74,7 @@ def runAllTests( jsontest_executable_path, input_dir = None,
7374 is_json_checker_test = (input_path in test_jsonchecker ) or expect_failure
7475 print ('TESTING:' , input_path , end = ' ' )
7576 options = is_json_checker_test and '--json-checker' or ''
76- options += ' --json-writer StyledWriter'
77+ options += ' --json-writer %s' % writerClass
7778 cmd = '%s%s %s "%s"' % (
7879 valgrind_path , jsontest_executable_path , options ,
7980 input_path )
@@ -147,7 +148,15 @@ def main():
147148 else :
148149 input_path = None
149150 status = runAllTests ( jsontest_executable_path , input_path ,
150- use_valgrind = options .valgrind , with_json_checker = options .with_json_checker )
151+ use_valgrind = options .valgrind ,
152+ with_json_checker = options .with_json_checker ,
153+ writerClass = 'StyledWriter' )
154+ if status :
155+ sys .exit ( status )
156+ status = runAllTests ( jsontest_executable_path , input_path ,
157+ use_valgrind = options .valgrind ,
158+ with_json_checker = options .with_json_checker ,
159+ writerClass = 'StyledStreamWriter' )
151160 sys .exit ( status )
152161
153162if __name__ == '__main__' :
0 commit comments