diff options
| author | Matthias Braun <matze@braunis.de> | 2015-10-28 02:36:35 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2015-10-28 02:36:35 +0000 |
| commit | be97829140fda2118d69d75e5c88d2ef01a3e4d1 (patch) | |
| tree | 678e0c8523cb050da7a810cc3a04ded1ace39f3e /llvm/utils | |
| parent | 04c2e85918fef831e0d1cc3c15d5d0501b727835 (diff) | |
| download | bcm5719-llvm-be97829140fda2118d69d75e5c88d2ef01a3e4d1.tar.gz bcm5719-llvm-be97829140fda2118d69d75e5c88d2ef01a3e4d1.zip | |
lit/TestRunner.py: Make parseIntegratedTestScriptCommands() keyword list a parameter; NFC
This allows the function to be easily reused and also simplifies the
code as the keyword list is next to the keyword handling now.
llvm-svn: 251478
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/lit/lit/TestRunner.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index 24075ff9404..548081225be 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -362,7 +362,7 @@ def executeScript(test, litConfig, tmpBase, commands, cwd): return lit.util.executeCommand(command, cwd=cwd, env=test.config.environment) -def parseIntegratedTestScriptCommands(source_path): +def parseIntegratedTestScriptCommands(source_path, keywords): """ parseIntegratedTestScriptCommands(source_path) -> commands @@ -381,7 +381,6 @@ def parseIntegratedTestScriptCommands(source_path): # remaining code can work with "strings" agnostic of the executing Python # version. - keywords = ['RUN:', 'XFAIL:', 'REQUIRES:', 'UNSUPPORTED:', 'END.'] keywords_re = re.compile( to_bytes("(%s)(.*)\n" % ("|".join(k for k in keywords),))) @@ -469,8 +468,9 @@ def parseIntegratedTestScript(test, normalize_slashes=False, script = [] requires = [] unsupported = [] + keywords = ['RUN:', 'XFAIL:', 'REQUIRES:', 'UNSUPPORTED:', 'END.'] for line_number, command_type, ln in \ - parseIntegratedTestScriptCommands(sourcepath): + parseIntegratedTestScriptCommands(sourcepath, keywords): if command_type == 'RUN': # Trim trailing whitespace. ln = ln.rstrip() |

