aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2018-05-08 13:34:31 +0300
committerDominic Hamon <dominichamon@users.noreply.github.com>2018-05-08 11:34:31 +0100
commit718cc91d004e15ce483cb1ba9bcd5e3a1f025184 (patch)
tree7ca670de83fcff6d1c2b5205d2ef9d5753b24229 /tools
parente8ddd907bb6a881f40069ea73caa74cb9112c564 (diff)
downloadgoogle-benchmark-718cc91d004e15ce483cb1ba9bcd5e3a1f025184.tar.gz
[Tools] Fix a few python3-compatibility issues (#585)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/compare.py8
-rw-r--r--tools/gbench/report.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/tools/compare.py b/tools/compare.py
index c4a47e8..f0a4455 100755
--- a/tools/compare.py
+++ b/tools/compare.py
@@ -138,6 +138,9 @@ def main():
# Parse the command line flags
parser = create_parser()
args, unknown_args = parser.parse_known_args()
+ if args.mode is None:
+ parser.print_help()
+ exit(1)
assert not unknown_args
benchmark_options = args.benchmark_options
@@ -175,6 +178,7 @@ def main():
else:
# should never happen
print("Unrecognized mode of operation: '%s'" % args.mode)
+ parser.print_help()
exit(1)
check_inputs(test_baseline, test_contender, benchmark_options)
@@ -218,8 +222,8 @@ class TestParser(unittest.TestCase):
os.path.realpath(__file__)),
'gbench',
'Inputs')
- self.testInput0 = os.path.join(testInputs, 'test_baseline_run1.json')
- self.testInput1 = os.path.join(testInputs, 'test_baseline_run2.json')
+ self.testInput0 = os.path.join(testInputs, 'test1_run1.json')
+ self.testInput1 = os.path.join(testInputs, 'test1_run2.json')
def test_benchmarks_basic(self):
parsed = self.parser.parse_args(
diff --git a/tools/gbench/report.py b/tools/gbench/report.py
index 8d68fe9..0c09098 100644
--- a/tools/gbench/report.py
+++ b/tools/gbench/report.py
@@ -191,7 +191,7 @@ class TestReportDifferenceBetweenFamilies(unittest.TestCase):
json2 = filter_benchmark(json, "BM_O.e", ".")
output_lines_with_header = generate_difference_report(json1, json2, use_color=False)
output_lines = output_lines_with_header[2:]
- print "\n"
+ print("\n")
print("\n".join(output_lines_with_header))
self.assertEqual(len(output_lines), len(expect_lines))
for i in range(0, len(output_lines)):