diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 11:27:37 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 11:27:37 +0000 |
| commit | 97ea867690314be089744a52931b42a7f6a291a1 (patch) | |
| tree | 4c54cfa14e84fced5cc4047028141521d1f5a2e2 /clang/utils/test/TestRunner.py | |
| parent | 3ab3b5e17a6880b582f86e65ccab352de2d5a362 (diff) | |
| download | bcm5719-llvm-97ea867690314be089744a52931b42a7f6a291a1.tar.gz bcm5719-llvm-97ea867690314be089744a52931b42a7f6a291a1.zip | |
MultiTestRunner: Validate '&&' at the end of RUN lines.
- This is just to normalize, these will go away soon hopefully.
Added all the missing '&&'s that have crept in. :)
llvm-svn: 77062
Diffstat (limited to 'clang/utils/test/TestRunner.py')
| -rwxr-xr-x | clang/utils/test/TestRunner.py | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/clang/utils/test/TestRunner.py b/clang/utils/test/TestRunner.py index 246a22b4389..5639a378e7b 100755 --- a/clang/utils/test/TestRunner.py +++ b/clang/utils/test/TestRunner.py @@ -122,23 +122,46 @@ def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC, ('%t',TEMPOUTPUT), (' clang ', ' ' + CLANG + ' '), (' clang-cc ', ' ' + CLANGCC + ' ')] + + # Collect the test lines from the script. scriptLines = [] xfailLines = [] for ln in open(scriptFile): if 'RUN:' in ln: - # Isolate run parameters + # Isolate the command to run. index = ln.index('RUN:') ln = ln[index+4:] - - # Apply substitutions - for a,b in substitutions: - ln = ln.replace(a,b) - - if useDGCompat: - ln = re.sub(r'\{(.*)\}', r'"\1"', ln) - scriptLines.append(ln) + + # Strip whitespace and append. + scriptLines.append(ln.strip()) elif 'XFAIL' in ln: xfailLines.append(ln) + + # FIXME: Support something like END, in case we need to process large + # files. + + # Validate interior lines for '&&', a lovely historical artifact. + for i in range(len(scriptLines) - 1): + ln = scriptLines[i] + + if not ln.endswith('&&'): + print >>output, "MISSING \'&&\': %s" % ln + print >>output, "FOLLOWED BY : %s" % scriptLines[i + 1] + return TestStatus.Fail + + # Strip off '&&' + scriptLines[i] = ln[:-2] + + # Apply substitutions to the script. + def processLine(ln): + # Apply substitutions + for a,b in substitutions: + ln = ln.replace(a,b) + + if useDGCompat: + ln = re.sub(r'\{(.*)\}', r'"\1"', ln) + return ln + scriptLines = map(processLine, scriptLines) if xfailLines: print >>output, "XFAILED '%s':"%(TESTNAME,) @@ -146,7 +169,7 @@ def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC, # Write script file f = open(SCRIPT,'w') - f.write(''.join(scriptLines)) + f.write(' &&\n'.join(scriptLines)) f.close() outputFile = open(OUTPUT,'w') |

