[test-suite] r353169 - Python Compat: print statements
Serge Guelton via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 5 06:00:09 PST 2019
Author: serge_sans_paille
Date: Tue Feb 5 06:00:09 2019
New Revision: 353169
URL: http://llvm.org/viewvc/llvm-project?rev=353169&view=rev
Log:
Python Compat: print statements
Differential Revision: https://reviews.llvm.org/D57744
Modified:
test-suite/trunk/ABI-Testsuite/linux-x86.py
test-suite/trunk/LNTBased/lib/spec.py
Modified: test-suite/trunk/ABI-Testsuite/linux-x86.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/linux-x86.py?rev=353169&r1=353168&r2=353169&view=diff
==============================================================================
--- test-suite/trunk/ABI-Testsuite/linux-x86.py (original)
+++ test-suite/trunk/ABI-Testsuite/linux-x86.py Tue Feb 5 06:00:09 2019
@@ -1,6 +1,7 @@
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+from __future__ import print_function
import os
import sys
wopt = " -w"
@@ -71,22 +72,22 @@ def build_linker_name(cn):
import subprocess
if __name__ == "__main__":
- print sys.argv
+ print(sys.argv)
litargs = [sys.argv[0]] # args for lit.main
c_compiler_name = sys.argv[1].strip()
cxx_compiler_name = build_cxx_compiler_name(c_compiler_name)
linker_name = build_linker_name(c_compiler_name)
- #print "C++ compiler:", cxx_compiler_name
- #print "linker :", linker_name
+ #print("C++ compiler:", cxx_compiler_name)
+ #print("linker :", linker_name)
for la in sys.argv[2:]:
litargs.append(la)
sys.argv = litargs
cmd = c_compiler_name.split() + [ "-o", "b.exe", "test/common/genselector.c"]
- #print "cmd = ", cmd
+ #print("cmd = ", cmd)
rv = subprocess.call(cmd)
- #print "rv = " , rv
+ #print("rv = " , rv)
if rv != 0:
- print "compiler failed: ", cmd
+ print("compiler failed: ", cmd)
sys.exit(1)
rv = subprocess.call("./b.exe")
fp = open("nselector.h")
@@ -105,14 +106,14 @@ if __name__ == "__main__":
test_params["linker"] = linker_name
test_params["Platform"] = "linux-" + cmd[0]
- print "test_params = " , test_params
+ print("test_params = " , test_params)
builtin_parameters = {
'build_mode' : "Release",
'llvm_site_config' : os.path.join(os.getcwd(), 'lit.site.cfg'),
'clang_site_config': os.path.join(os.getcwd(), 'lit.site.cfg'),
'test_params' : test_params
}
- #print "builtin_params = " , test_params
+ #print("builtin_params = " , test_params)
from lit.main import main
main(builtin_parameters)
Modified: test-suite/trunk/LNTBased/lib/spec.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/LNTBased/lib/spec.py?rev=353169&r1=353168&r2=353169&view=diff
==============================================================================
--- test-suite/trunk/LNTBased/lib/spec.py (original)
+++ test-suite/trunk/LNTBased/lib/spec.py Tue Feb 5 06:00:09 2019
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# -*- Python -*-
+from __future__ import print_function
import os
import shutil
@@ -109,7 +110,7 @@ class TestModule(nt.TestModule):
with open(command_file, 'w') as f:
# Chdir here so that the redirects are put into CWD as well.
remote_command = 'cd %s\n%s\n' % (cwd, cmdstr)
- print >>self.log, "command:", remote_command,
+ print("command:", remote_command, file=self.log, end=' ')
f.write(remote_command)
st = os.stat(command_file)
@@ -155,10 +156,10 @@ class TestModule(nt.TestModule):
suitedir = os.path.join(suitedir, 'CPU' + self.year)
self.datadir = os.path.join(suitedir, self.benchmark, 'data')
- print >>self.log, "%s\n options: %s\n\nmake variables: %s\n\n" % (self.testname, str(options), str(make_variables))
+ print("%s\n options: %s\n\nmake variables: %s\n\n" % (self.testname, str(options), str(make_variables)), file=self.log)
if not os.path.exists(self.datadir):
- print >>self.log, "skipping, no source under externals"
+ print("skipping, no source under externals", file=self.log)
return []
res = self.configure_test_suite(self.OBJROOT)
@@ -209,7 +210,7 @@ class TestModule(nt.TestModule):
if result != 0:
return self.fail()
if not os.path.exists(os.path.join(pgo_dir, 'run_%d.profraw' % i)):
- print >>self.log, 'Failed to create PGO output'
+ print('Failed to create PGO output', file=self.log)
return self.fail()
llvm_profdata = os.path.join(os.path.dirname(CC), 'llvm-profdata')
More information about the llvm-commits
mailing list