tests: Add missing print replacements in tests subdir
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 13 Mar 2018 16:13:53 +0000 (16:13 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 14 Mar 2018 10:34:02 +0000 (10:34 +0000)
Some python files were still using deprecated print statement.

Change-Id: I19b1fe9c28650707f01725d40c87ad0538f9c5e6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/9141
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

tests/configs/gpu-ruby.py
tests/testing/results.py

index 6b20c31e860a2e049d1dc86dba4445cebbcc31db..e846dbaf62b8caf7d78512909df6318a71ccc8cd 100644 (file)
@@ -33,6 +33,8 @@
 #  Author: Brad Beckmann
 #
 
+from __future__ import print_function
+
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
@@ -77,7 +79,7 @@ def run_test(root):
 
     # simulate until program terminates
     exit_event = m5.simulate(maxtick)
-    print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
+    print('Exiting @ tick', m5.curTick(), 'because', exit_event.getCause())
 
 parser = optparse.OptionParser()
 Options.addCommonOptions(parser)
index 387362a75f577fc428bd794bc95f363208dd9892..4e0707860388da8c63481b04abc4a7d0da2be786 100644 (file)
@@ -37,6 +37,8 @@
 #
 # Authors: Andreas Sandberg
 
+from __future__ import print_function
+
 from abc import ABCMeta, abstractmethod
 import inspect
 import pickle
@@ -173,21 +175,21 @@ class Text(ResultFormatter):
     def dump_suites(self, suites):
         fout = self.fout
         for suite in suites:
-            print >> fout, "--- %s ---" % suite.name
+            print("--- %s ---" % suite.name, file=fout)
 
             for t in suite.results:
-                print >> fout, "*** %s" % t
+                print("*** %s" % t, file=fout)
 
                 if t and not self.verbose:
                     continue
 
                 if t.message:
-                    print >> fout, t.message
+                    print(t.message, file=fout)
 
                 if t.stderr:
-                    print >> fout, t.stderr
+                    print(t.stderr, file=fout)
                 if t.stdout:
-                    print >> fout, t.stdout
+                    print(t.stdout, file=fout)
 
 class TextSummary(ResultFormatter):
     """Output test results as a text summary"""
@@ -209,7 +211,7 @@ class TextSummary(ResultFormatter):
         fout = self.fout
         for suite in suites:
             status = self.test_status(suite)
-            print >> fout, "%s: %s" % (suite.name, status)
+            print("%s: %s" % (suite.name, status), file=fout)
 
 class JUnit(ResultFormatter):
     """Output test results as JUnit XML"""