[test-suite] r262304 - lit: Fix a bunch of pep8 violations
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 29 22:05:22 PST 2016
Author: matze
Date: Tue Mar 1 00:05:22 2016
New Revision: 262304
URL: http://llvm.org/viewvc/llvm-project?rev=262304&view=rev
Log:
lit: Fix a bunch of pep8 violations
Modified:
test-suite/trunk/litsupport/runsafely.py
test-suite/trunk/litsupport/shellcommand.py
test-suite/trunk/litsupport/test.py
Modified: test-suite/trunk/litsupport/runsafely.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/runsafely.py?rev=262304&r1=262303&r2=262304&view=diff
==============================================================================
--- test-suite/trunk/litsupport/runsafely.py (original)
+++ test-suite/trunk/litsupport/runsafely.py Tue Mar 1 00:05:22 2016
@@ -35,7 +35,8 @@ def prepareRunSafely(context, commandlin
runsafely_prefix += ["-e", cmd.stderr]
else:
if cmd.stdout is not None or cmd.stderr is not None:
- raise Exception("separate stdout/stderr redirection not possible with traditional output")
+ raise Exception("Separate stdout/stderr redirection not " +
+ "possible with traditional output")
timeout = "7200"
if cmd.stdin is not None:
stdin = cmd.stdin
Modified: test-suite/trunk/litsupport/shellcommand.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/shellcommand.py?rev=262304&r1=262303&r2=262304&view=diff
==============================================================================
--- test-suite/trunk/litsupport/shellcommand.py (original)
+++ test-suite/trunk/litsupport/shellcommand.py Tue Mar 1 00:05:22 2016
@@ -2,13 +2,14 @@ import shlex
import logging
# Loosely modeled after posix specification for sh
-reserved_words = [ '!', '{', '}', 'case', 'do', 'done', 'elif', 'else', 'esac',
- 'fi', 'for', 'if', 'in', 'then', 'until', 'while' ]
+reserved_words = ['!', '{', '}', 'case', 'do', 'done', 'elif', 'else', 'esac',
+ 'fi', 'for', 'if', 'in', 'then', 'until', 'while']
chaining_tokens = set([';', '&&', '||', '|', '&'])
unhandled_tokens = set([';;', '<<', '>>', '<&', '>&', '<>', '<<-', '>|', '(',
')'])
+
class ShellCommand:
def __init__(self):
self.stdin = None
@@ -19,6 +20,7 @@ class ShellCommand:
self.modifiers = None
self.workdir = None
+
def parse(commandline):
previous_commands = []
result = ShellCommand()
@@ -30,15 +32,15 @@ def parse(commandline):
i += 1
if token == '<' and i < len(tokens):
result.stdin = tokens[i]
- i+=1
+ i += 1
continue
if token == '>' and i < len(tokens):
result.stdout = tokens[i]
- i+=1
+ i += 1
continue
if token == '2>' and i < len(tokens):
result.stderr = tokens[i]
- i+=1
+ i += 1
continue
if first_word:
if token in reserved_words or token in unhandled_tokens:
Modified: test-suite/trunk/litsupport/test.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/test.py?rev=262304&r1=262303&r2=262304&view=diff
==============================================================================
--- test-suite/trunk/litsupport/test.py (original)
+++ test-suite/trunk/litsupport/test.py Tue Mar 1 00:05:22 2016
@@ -19,9 +19,9 @@ import timeit
class TestContext:
"""This class is used to hold data used while constructing a testrun.
- For example this can be used by modules modifying the commandline with extra
- instrumentation/measurement wrappers to pass the filenames of the results
- to a final data collection step."""
+ For example this can be used by modules modifying the commandline with
+ extra instrumentation/measurement wrappers to pass the filenames of the
+ results to a final data collection step."""
def __init__(self, test, litConfig, original_runscript,
original_verifyscript, tmpDir, tmpBase):
self.test = test
@@ -67,7 +67,7 @@ class TestSuiteTest(FileBasedTest):
runscript = applySubstitutions(runscript, substitutions)
verifyscript = applySubstitutions(verifyscript, substitutions)
metricscripts = {k: applySubstitutions(v, substitutions)
- for k,v in metricscripts.items()}
+ for k, v in metricscripts.items()}
context = TestContext(test, litConfig, runscript, verifyscript, tmpDir,
tmpBase)
@@ -106,7 +106,7 @@ class TestSuiteTest(FileBasedTest):
out, err, exitCode, timeoutInfo = res
metrics.setdefault(metric, list()).append(float(out))
-
+
try:
runtime = runsafely.getTime(context)
runtimes.append(runtime)
@@ -114,15 +114,16 @@ class TestSuiteTest(FileBasedTest):
pass
if litConfig.params.get('profile') == 'perf':
- profilescript = perf.wrapScript(context, context.original_runscript)
+ profilescript = perf.wrapScript(context,
+ context.original_runscript)
profilescript = runsafely.wrapScript(context, profilescript,
suffix=".perf.out")
- runScript(context, context.profilescript) # ignore result
+ runScript(context, context.profilescript) # ignore result
# Merge llvm profile data
if config.profile_generate:
mergescript = profilegen.getMergeProfilesScript(context)
- runScript(context, mergescript) # ignore result
+ runScript(context, mergescript) # ignore result
# Run verification script (the "VERIFY:" part)
if len(verifyscript) > 0:
More information about the llvm-commits
mailing list