summaryrefslogtreecommitdiff
path: root/tests/tests.py
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2018-03-09 11:47:25 +0000
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2018-03-09 22:45:20 +0000
commitb3d0f2d66a5bf79f66893adcb85b0ac78daf3f65 (patch)
treeb69b4472d7a21b9bdb8a5d43f197d03c850fd7e0 /tests/tests.py
parentee16a95ec8a7f2d207320670a135065981033f61 (diff)
downloadgem5-b3d0f2d66a5bf79f66893adcb85b0ac78daf3f65.tar.xz
tests: Python regression scripts using new print function
Change-Id: I92060da4537e4ff1c0ff665f2f6ffc3850c50e88 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com> Reviewed-on: https://gem5-review.googlesource.com/8892 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'tests/tests.py')
-rwxr-xr-xtests/tests.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/tests.py b/tests/tests.py
index 2ae4a7879..a57a97228 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -37,6 +37,8 @@
#
# Authors: Andreas Sandberg
+from __future__ import print_function
+
import argparse
import sys
import os
@@ -126,7 +128,7 @@ def _list_tests(args):
for test in get_tests(isa, categories=categories, modes=modes,
ruby_protocol=args.ruby_protocol,
gpu_isa=args.gpu_isa):
- print "/".join(test)
+ print("/".join(test))
sys.exit(0)
def _run_tests_args(subparsers):
@@ -175,8 +177,8 @@ def _run_tests_args(subparsers):
def _run_tests(args):
if not os.path.isfile(args.gem5) or not os.access(args.gem5, os.X_OK):
- print >> sys.stderr, \
- "gem5 binary '%s' not an executable file" % args.gem5
+ print("gem5 binary '%s' not an executable file" % args.gem5,
+ file=sys.stderr)
sys.exit(2)
formatter = _create_formatter(args)
@@ -195,9 +197,9 @@ def _run_tests(args):
skip_diff_out=args.skip_diff_out))
all_results = []
- print "Running %i tests" % len(tests)
+ print("Running %i tests" % len(tests))
for testno, test in enumerate(tests):
- print "%i: Running '%s'..." % (testno, test)
+ print("%i: Running '%s'..." % (testno, test))
all_results.append(test.run())
@@ -249,7 +251,7 @@ def _show(args):
try:
return pickle.load(f)
except EOFError:
- print >> sys.stderr, 'Could not read file %s' % f.name
+ print('Could not read file %s' % f.name, file=sys.stderr)
return []
formatter = _create_formatter(args)
@@ -287,7 +289,7 @@ def _test(args):
try:
suites = sum([ pickle.load(f) for f in args.result ], [])
except EOFError:
- print >> sys.stderr, 'Could not read all files'
+ print('Could not read all files', file=sys.stderr)
sys.exit(2)
if all(s for s in suites):