summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-01-08 18:09:48 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-01-08 18:09:48 +0000
commit7c9eab8fef0ed79a5911d21eb97b6b0fa9d39f82 (patch)
tree417c346383ef24234be018d7dea56d36248b0261 /llvm
parent7fab23bc1dfd5ab5932dfadbb9a87f4813ebf3ef (diff)
downloadbcm5719-llvm-7c9eab8fef0ed79a5911d21eb97b6b0fa9d39f82.tar.gz
bcm5719-llvm-7c9eab8fef0ed79a5911d21eb97b6b0fa9d39f82.zip
On Windows, replace each occurrence of '\' by '\\' on the replacement string. This is necessary to prevent re.sub from replacing escape sequences occurring in path.
For example: llvm\tools\clang\test was replaced by llvm <tab> ools\clang <tab> est llvm-svn: 123070
Diffstat (limited to 'llvm')
-rw-r--r--llvm/utils/lit/lit/TestRunner.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 6430cddf912..dba78143bee 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -451,12 +451,10 @@ def parseIntegratedTestScript(test, normalize_slashes=False):
# expression pattern a with substitution b in line ln.
def processLine(ln):
# Apply substitutions
- # FIXME: Investigate why re.sub doesn't work on Windows
for a,b in substitutions:
if kIsWindows:
- ln = ln.replace(a,b)
- else:
- ln = re.sub(a, b, ln)
+ b = b.replace("\\","\\\\")
+ ln = re.sub(a, b, ln)
# Strip the trailing newline and any extra whitespace.
return ln.strip()
OpenPOWER on IntegriCloud