@@ -11,7 +11,6 @@ BASE_DIR = os.path.dirname(os.path.realpath(__file__))
1111PARSERS_DIR = os.path.join(BASE_DIR, "parsers")
1212TEST_CASES_DIR_PATH = os.path.join(BASE_DIR, "test_parsing")
1313LOGS_DIR_PATH = os.path.join(BASE_DIR, "results")
14−REPORT_PATH = os.path.join(BASE_DIR, "results/parsing.html")
1514LOG_FILENAME = "logs.txt"
1615LOG_FILE_PATH = os.path.join(LOGS_DIR_PATH, LOG_FILENAME)
1716
@@ -476,7 +475,7 @@ def f_tests_with_same_results(libs, status_for_lib_for_file):
476475
477476 return r
478477
479−def generate_report(keep_only_first_result_in_set = False):
478+def generate_report(report_path, keep_only_first_result_in_set = False):
480479
481480 (status_for_lib_for_file, libs) = f_status_for_lib_for_file(TEST_CASES_DIR_PATH, LOGS_DIR_PATH)
482481
@@ -484,7 +483,7 @@ def generate_report(keep_only_first_result_in_set = False):
484483
485484 tests_with_same_results = f_tests_with_same_results(libs, status_for_lib_for_file)
486485
487− with open(REPORT_PATH, 'w') as f:
486+ with open(report_path, 'w') as f:
488487
489488 f.write("""<!DOCTYPE html>
490489
@@ -505,7 +504,12 @@ def generate_report(keep_only_first_result_in_set = False):
505504 libs = list(status_for_path_for_lib.keys())
506505 libs.sort()
507506
508− f.write("<H1>JSON Parsing Tests</H1>\n")
507+ title = "JSON Parsing Tests"
508+ if keep_only_first_result_in_set:
509+ title += ", Prunned"
510+ else:
511+ title += ", Full"
512+ f.write("<H1>%s</H1>\n" % title)
509513 f.write('<P>Appendix to: seriot.ch <A HREF="http://www.seriot.ch/parsing_json.php">Parsing JSON is a Minefield</A> http://www.seriot.ch/parsing_json.php</P>\n')
510514 f.write("<PRE>%s</PRE>\n" % strftime("%Y-%m-%d %H:%M:%S"))
511515
@@ -635,7 +639,7 @@ def generate_report(keep_only_first_result_in_set = False):
635639 </HTML>
636640 """)
637641
638− os.system("/usr/bin/open %s" % REPORT_PATH)
642+ os.system('/usr/bin/open "%s"' % report_path)
639643
640644###
641645
@@ -650,4 +654,5 @@ if __name__ == '__main__':
650654
651655 run_tests(restrict_to_path)
652656
653− generate_report(keep_only_first_result_in_set = False)
657+ generate_report(os.path.join(BASE_DIR, "results/parsing.html"), keep_only_first_result_in_set = False)
658+ generate_report(os.path.join(BASE_DIR, "results/parsing_pruned.html"), keep_only_first_result_in_set = True)