diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-03-06 09:22:29 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-03-06 09:22:29 +0000 |
commit | 9bef28eb9e224d641ce31a423e215ccf82bf1d43 (patch) | |
tree | 542734eaa7870f95912cbaebccb87dbec0c20b4f /utils/lit/lit/TestRunner.py | |
parent | 8230c40430a1325b5cc5bc0221931487b4bd573c (diff) | |
download | FreeBSD-src-9bef28eb9e224d641ce31a423e215ccf82bf1d43.zip FreeBSD-src-9bef28eb9e224d641ce31a423e215ccf82bf1d43.tar.gz |
Update LLVM to r97873.
Diffstat (limited to 'utils/lit/lit/TestRunner.py')
-rw-r--r-- | utils/lit/lit/TestRunner.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 20fbc6c..a7de2b7 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' @@ -385,7 +387,21 @@ def parseIntegratedTestScript(test): script = [] xfails = [] xtargets = [] + ignoredAny = False for ln in open(sourcepath): + 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: + return (Test.UNRESOLVED, "unknown condition '"+condition+"'") + if not test.config.conditions[condition](value): + ignoredAny = True + continue + if 'RUN:' in ln: # Isolate the command to run. index = ln.index('RUN:') @@ -422,6 +438,8 @@ def parseIntegratedTestScript(test): # Verify the script contains a run line. if not script: + if ignoredAny: + return (Test.UNSUPPORTED, "Test has only ignored run lines") return (Test.UNRESOLVED, "Test has no run line!") if script[-1][-1] == '\\': |