summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2010-12-21 16:55:53 +0000
committerDavid Greene <greened@obbligato.org>2010-12-21 16:55:53 +0000
commita93adab324659949d6cf832fe87b56a761cc2ff6 (patch)
treed034c9bafa6b8daa6b5d2992149d8e56b8267840 /llvm/utils/lit
parent740857fa10e0e70b2145acb7164b9b526da89a0a (diff)
downloadbcm5719-llvm-a93adab324659949d6cf832fe87b56a761cc2ff6.tar.gz
bcm5719-llvm-a93adab324659949d6cf832fe87b56a761cc2ff6.zip
Fix PR 8199. This patch prepends the build tool dir to LLVM programs
being tested. This ensures that we test the tools just built and not some random tools that might happen to be in the user's PATH. This makes LLVM testing much more stable and predictable. llvm-svn: 122341
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r--llvm/utils/lit/lit/TestRunner.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index a2f97cdb5ef..bf6eed86917 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -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()
OpenPOWER on IntegriCloud