From 70704b9a707b83d66660425783e81f704bc2ce0c Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Fri, 23 Jan 2015 12:04:14 -0600 Subject: [PATCH] test both StyledWriter and StyledStreamWriter --- test/runjsontests.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/runjsontests.py b/test/runjsontests.py index 5230965..19903b9 100644 --- a/test/runjsontests.py +++ b/test/runjsontests.py @@ -58,7 +58,8 @@ def safeReadFile( path ): return '' % (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' ) ) @@ -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) @@ -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__':