Reapply 122341 to fix PR8199 now that clang changes are in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Greene
2011-01-03 17:30:25 +00:00
parent 0895db0abf
commit 18d4987753
3 changed files with 50 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ import Util
import platform
import tempfile
import re
class InternalShellError(Exception):
def __init__(self, command, message):
self.command = command
@@ -444,11 +446,13 @@ def parseIntegratedTestScript(test, normalize_slashes=False):
if ln[ln.index('END.'):].strip() == 'END.':
break
# Apply substitutions to the script.
# Apply substitutions to the script. Allow full regular
# expression syntax. Replace each matching occurrence of regular
# expression pattern a with substitution b in line ln.
def processLine(ln):
# Apply substitutions
for a,b in substitutions:
ln = ln.replace(a,b)
ln = re.sub(a, b, ln)
# Strip the trailing newline and any extra whitespace.
return ln.strip()