From df7c7ee1d37dda0fb597586b4624515166a778d0 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 6 Mar 2019 18:13:22 +0300 Subject: [PATCH] [Tooling] report.py: whoops, don't ignore the rest of benches after a bad one. Refs #779. --- tools/gbench/Inputs/test1_run1.json | 28 ++++++++++++++-------------- tools/gbench/Inputs/test1_run2.json | 28 ++++++++++++++-------------- tools/gbench/report.py | 4 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tools/gbench/Inputs/test1_run1.json b/tools/gbench/Inputs/test1_run1.json index b07db7c8..601e327a 100644 --- a/tools/gbench/Inputs/test1_run1.json +++ b/tools/gbench/Inputs/test1_run1.json @@ -84,20 +84,6 @@ "cpu_time": 100, "time_unit": "ns" }, - { - "name": "BM_BadTimeUnit", - "iterations": 1000, - "real_time": 0.4, - "cpu_time": 0.5, - "time_unit": "s" - }, - { - "name": "BM_DifferentTimeUnit", - "iterations": 1, - "real_time": 1, - "cpu_time": 1, - "time_unit": "s" - }, { "name": "MyComplexityTest_BigO", "run_name": "MyComplexityTest", @@ -114,6 +100,20 @@ "run_type": "aggregate", "aggregate_name": "RMS", "rms": 4.5097802512472874e-03 + }, + { + "name": "BM_NotBadTimeUnit", + "iterations": 1000, + "real_time": 0.4, + "cpu_time": 0.5, + "time_unit": "s" + }, + { + "name": "BM_DifferentTimeUnit", + "iterations": 1, + "real_time": 1, + "cpu_time": 1, + "time_unit": "s" } ] } diff --git a/tools/gbench/Inputs/test1_run2.json b/tools/gbench/Inputs/test1_run2.json index 8b7e8eca..3cbcf39b 100644 --- a/tools/gbench/Inputs/test1_run2.json +++ b/tools/gbench/Inputs/test1_run2.json @@ -84,20 +84,6 @@ "cpu_time": 66.664, "time_unit": "ns" }, - { - "name": "BM_BadTimeUnit", - "iterations": 1000, - "real_time": 0.04, - "cpu_time": 0.6, - "time_unit": "s" - }, - { - "name": "BM_DifferentTimeUnit", - "iterations": 1, - "real_time": 1, - "cpu_time": 1, - "time_unit": "ns" - }, { "name": "MyComplexityTest_BigO", "run_name": "MyComplexityTest", @@ -114,6 +100,20 @@ "run_type": "aggregate", "aggregate_name": "RMS", "rms": 3.3128901852342174e-03 + }, + { + "name": "BM_NotBadTimeUnit", + "iterations": 1000, + "real_time": 0.04, + "cpu_time": 0.6, + "time_unit": "s" + }, + { + "name": "BM_DifferentTimeUnit", + "iterations": 1, + "real_time": 1, + "cpu_time": 1, + "time_unit": "ns" } ] } diff --git a/tools/gbench/report.py b/tools/gbench/report.py index e1e1c146..49b46eca 100644 --- a/tools/gbench/report.py +++ b/tools/gbench/report.py @@ -137,7 +137,7 @@ def partition_benchmarks(json1, json2): time_unit = x['time_unit'] break if time_unit is None: - break + continue # Filter by name and time unit. # All the repetitions are assumed to be comparable. lhs = [x for x in json1['benchmarks'] if x['name'] == name and @@ -341,7 +341,7 @@ class TestReportDifference(unittest.TestCase): ['BM_10PercentCPUToTime', '+0.1000', '-0.1000', '100', '110', '100', '90'], ['BM_ThirdFaster', '-0.3333', '-0.3334', '100', '67', '100', '67'], - ['BM_BadTimeUnit', '-0.9000', '+0.2000', '0', '0', '0', '1'], + ['BM_NotBadTimeUnit', '-0.9000', '+0.2000', '0', '0', '0', '1'], ] json1, json2 = self.load_results() output_lines_with_header = generate_difference_report(