summaryrefslogtreecommitdiff
path: root/utils/lit/lit
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-04 11:48:42 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-04 11:48:42 +0000
commitb8f2e4bde682ae4697fcc8d46d125388fbe12447 (patch)
tree5420ed068cfba44aa39f7eb2eff0cba2837d53b8 /utils/lit/lit
parent7b7b90769ac1b1ed4ac3d506b57866d44130a36e (diff)
downloadllvm-b8f2e4bde682ae4697fcc8d46d125388fbe12447.tar.gz
llvm-b8f2e4bde682ae4697fcc8d46d125388fbe12447.tar.bz2
llvm-b8f2e4bde682ae4697fcc8d46d125388fbe12447.tar.xz
Simplify the condition-checking logic and hopefully clear up a build failure
that somehow got through my testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit/lit')
-rw-r--r--utils/lit/lit/TestRunner.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 148beba0ca..a7de2b79f8 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -353,6 +353,8 @@ def isExpectedFail(xfails, xtargets, target_triple):
return True
+import re
+
def parseIntegratedTestScript(test):
"""parseIntegratedTestScript - Scan an LLVM/Clang style integrated test
script and extract the lines to 'RUN' as well as 'XFAIL' and 'XTARGET'
@@ -387,20 +389,11 @@ def parseIntegratedTestScript(test):
xtargets = []
ignoredAny = False
for ln in open(sourcepath):
- if 'IF(' in ln:
- # Required syntax here is IF(condition(value)):
- index = ln.index('IF(')
- ln = ln[index+3:]
- index = ln.index('(')
- if index is -1:
- return (Test.UNRESOLVED, "ill-formed IF at '"+ln[:10]+"'")
- condition = ln[:index]
- ln = ln[index+1:]
- index = ln.index(')')
- if index is -1 or ln[index:index+3] != ')):':
- return (Test.UNRESOLVED, "ill-formed IF at '"+ln[:10]+"'")
- value = ln[:index]
- ln = ln[index+3:]
+ conditional = re.search('IF\((.+?)\((.+?)\)\):', ln)
+ if conditional:
+ ln = ln[conditional.end():]
+ condition = conditional.group(1)
+ value = conditional.group(2)
# Actually test the condition.
if condition not in test.config.conditions: