summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/driver/cpu_features.py3
-rw-r--r--testsuite/driver/runtests.py6
-rw-r--r--testsuite/tests/codeGen/should_compile/all.T2
3 files changed, 6 insertions, 5 deletions
diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py
index 6e32d3b445..43500130db 100644
--- a/testsuite/driver/cpu_features.py
+++ b/testsuite/driver/cpu_features.py
@@ -17,7 +17,8 @@ cpu_feature_cache = None
def get_cpu_features():
if config.os in ['mingw32', 'linux'] and os.path.exists('/proc/cpuinfo'):
- f = open('/proc/cpuinfo').read()
+ with open('/proc/cpuinfo') as x:
+ f = x.read()
flags = re.search(r'flags\s*:\s*.*$', f, re.M)
if flags is None:
print('get_cpu_features: failed to find cpu features')
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index e254ff13aa..223d644ee6 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -99,7 +99,8 @@ if args.e:
if args.config_file:
for arg in args.config_file:
- exec(open(arg).read())
+ with io.open(arg) as f:
+ exec(f.read())
if args.config:
for arg in args.config:
@@ -349,8 +350,6 @@ except Exception as e:
print('Failed to detect CPU features: ', e)
sys.stdout.flush()
-# we output text, which cannot be unbuffered
-sys.stdout = os.fdopen(sys.__stdout__.fileno(), "w")
if config.local:
tempdir = ''
@@ -607,6 +606,7 @@ else:
print("WARNING - skipping all tests and only reporting required hadrian dependencies:", config.hadrian_deps)
for d in config.hadrian_deps:
print(d,file=config.only_report_hadrian_deps)
+ config.only_report_hadrian_deps.close()
if len(t.unexpected_failures) > 0 or \
len(t.unexpected_stat_failures) > 0 or \
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index fb469a292b..7e5d1d39f2 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -96,7 +96,7 @@ test('T14373c',
switch_skeleton_only])
switch_skeleton_and_entries_only = (r'grep -e "switch \[" -e "case " -e "default: " -e "Default_entry(" -e "R1 = .*_closure+2;"'
- '| sed -e "s|\] .*|\]|g" -e "s|goto .*|goto |g" -e "s|R1 = .*_closure+2;.*|R1 = XYZ_closure+2;|g" -e "s|//.*|//|g"')
+ r'| sed -e "s|\] .*|\]|g" -e "s|goto .*|goto |g" -e "s|R1 = .*_closure+2;.*|R1 = XYZ_closure+2;|g" -e "s|//.*|//|g"')
test('T14373d',
[ js_skip # JS backend doesn't produce Cmm