diff --git a/benchtests/scripts/compare_bench.py b/benchtests/scripts/compare_bench.py index 6fcbd08038..1a497f8bb6 100755 --- a/benchtests/scripts/compare_bench.py +++ b/benchtests/scripts/compare_bench.py @@ -163,7 +163,11 @@ def plot_graphs(bench1, bench2): def main(bench1, bench2, schema, threshold, stats): bench1 = bench.parse_bench(bench1, schema) + bench.do_for_all_timings(bench1, lambda b, f, v: + b['functions'][f][v]['timings'].sort()) bench2 = bench.parse_bench(bench2, schema) + bench.do_for_all_timings(bench2, lambda b, f, v: + b['functions'][f][v]['timings'].sort()) plot_graphs(bench1, bench2) diff --git a/benchtests/scripts/import_bench.py b/benchtests/scripts/import_bench.py index a799b4e1b7..362c990fe1 100644 --- a/benchtests/scripts/import_bench.py +++ b/benchtests/scripts/import_bench.py @@ -136,6 +136,4 @@ def parse_bench(filename, schema_filename): with open(filename, 'r') as benchfile: bench = json.load(benchfile) validator.validate(bench, schema) - do_for_all_timings(bench, lambda b, f, v: - b['functions'][f][v]['timings'].sort()) return bench diff --git a/benchtests/scripts/validate_benchout.py b/benchtests/scripts/validate_benchout.py index 47df33ed02..00d5fa0ee5 100755 --- a/benchtests/scripts/validate_benchout.py +++ b/benchtests/scripts/validate_benchout.py @@ -73,11 +73,15 @@ def main(args): except bench.validator.ValidationError as e: return print_and_exit("Invalid benchmark output: %s" % e.message, - os.EX_DATAERR) + os.EX_DATAERR) except bench.validator.SchemaError as e: return print_and_exit("Invalid schema: %s" % e.message, os.EX_DATAERR) + except json.decoder.JSONDecodeError as e: + return print_and_exit("Benchmark output in %s is not JSON." % args[0], + os.EX_DATAERR) + print("Benchmark output in %s is valid." % args[0]) return os.EX_OK