@@ -73,45 +73,26 @@ def runAllTests(jsontest_executable_path, input_dir = None,
7373 input_dir = os .path .join (os .getcwd (), 'data' )
7474 tests = glob (os .path .join (input_dir , '*.json' ))
7575 if with_json_checker :
76- all_test_jsonchecker = glob (os .path .join (input_dir , '../jsonchecker' , '*.json' ))
77- # These tests fail with strict json support, but pass with jsoncpp extra lieniency
78- """
79- Failure details:
80- * Test ../jsonchecker/fail25.json
81- Parsing should have failed:
82- [" tab character in string "]
83-
84- * Test ../jsonchecker/fail13.json
85- Parsing should have failed:
86- {"Numbers cannot have leading zeroes": 013}
87-
88- * Test ../jsonchecker/fail18.json
89- Parsing should have failed:
90- [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
91-
92- * Test ../jsonchecker/fail8.json
93- Parsing should have failed:
94- ["Extra close"]]
95-
96- * Test ../jsonchecker/fail7.json
97- Parsing should have failed:
98- ["Comma after the close"],
99-
100- * Test ../jsonchecker/fail10.json
101- Parsing should have failed:
102- {"Extra value after close": true} "misplaced quoted value"
103-
104- * Test ../jsonchecker/fail27.json
105- Parsing should have failed:
106- ["line
107- break"]
108- """
109- known_differences_withjsonchecker = [ "fail25.json" , "fail13.json" , "fail18.json" , "fail8.json" ,
110- "fail7.json" , "fail10.json" , "fail27.json" ]
111- test_jsonchecker = [ test for test in all_test_jsonchecker if os .path .basename (test ) not in known_differences_withjsonchecker ]
76+ all_tests = glob (os .path .join (input_dir , '../jsonchecker' , '*.json' ))
77+ # These tests fail with strict json support, but pass with JsonCPP's
78+ # extra leniency features. When adding a new exclusion to this list,
79+ # remember to add the test's number and reasoning here:
80+ known = ["fail{}.json" .format (n ) for n in [
81+ 4 , 9 , # fail because we allow trailing commas
82+ 7 , # fails because we allow commas after close
83+ 8 , # fails because we allow extra close
84+ 10 , # fails because we allow extra values after close
85+ 13 , # fails because we allow leading zeroes in numbers
86+ 18 , # fails because we allow deeply nested values
87+ 25 , # fails because we allow tab characters in strings.
88+ 27 , # fails because we allow string line breaks
89+ ]]
90+ test_jsonchecker = [ test for test in all_tests
91+ if os .path .basename (test ) not in known ]
11292
11393 else :
11494 test_jsonchecker = []
95+
11596 failed_tests = []
11697 valgrind_path = use_valgrind and VALGRIND_CMD or ''
11798 for input_path in tests + test_jsonchecker :
0 commit comments