diff options
author | John McCall <rjmccall@apple.com> | 2010-03-04 11:48:42 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-04 11:48:42 +0000 |
commit | 77ffdaf0336dbb53102c6e3433bfb24018af0437 (patch) | |
tree | cfc39ce4c9022dac0fe6d97f449bbbdbbb4d813f | |
parent | b07d8b56d279481c762935dcdc084869e36c5b57 (diff) | |
download | bcm5719-llvm-77ffdaf0336dbb53102c6e3433bfb24018af0437.tar.gz bcm5719-llvm-77ffdaf0336dbb53102c6e3433bfb24018af0437.zip |
Simplify the condition-checking logic and hopefully clear up a build failure
that somehow got through my testing.
llvm-svn: 97728
-rw-r--r-- | llvm/utils/lit/lit/TestRunner.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index 148beba0ca7..a7de2b79f8f 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/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: |