llvm-project/llvm/utils/lit/tests/Inputs
Eric Fiselier df87d070c9 [lit] Support custom parsers in parseIntegratedTestScript
Summary:
Libc++ frequently has the need to parse more than just the builtin *test keywords* (`RUN`, `REQUIRES`, `XFAIL`, ect). For example libc++ currently needs a new keyword `MODULES-DEFINES: macro list...`. Instead of re-implementing the script parsing in libc++ this patch allows `parseIntegratedTestScript` to take custom parsers.

This patch introduces a new class `IntegratedTestKeywordParser` which implements the logic to parse/process a test keyword. Parsing of various keyword "kinds" are supported out of the box, including 'TAG', 'COMMAND', and 'LIST', which parse keywords such as `END.`, `RUN:` and `XFAIL:` respectively.

As an example after this change libc++ can implement the `MODULES-DEFINES` simply using: 
```
mparser = IntegratedTestKeywordParser('MODULES-DEFINES:', ParserKind.LIST)
parseIntegratedTestScript(test, additional_parsers=[mparser])
macro_list = mparser.getValue()
```


Reviewers: ddunbar, modocache, rnk, danalbert, jroelofs

Subscribers: mgrang, llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D27005

llvm-svn: 288694
2016-12-05 20:21:21 +00:00
..
discovery
exec-discovery
exec-discovery-in-tree
googletest-format
googletest-timeout
googletest-upstream-format [lit][googletest] Handle upstream gtest output 2016-03-31 18:22:55 +00:00
progress-bar
shtest-format Add "REQUIRES-ANY" feature test 2016-06-02 01:59:57 +00:00
shtest-output-printing [lit] Improve logging with file redirection. 2016-06-07 16:13:40 +00:00
shtest-shell
shtest-timeout [lit] Remove unused imports (NFC) 2016-10-03 04:48:18 +00:00
test-data
testrunner-custom-parsers [lit] Support custom parsers in parseIntegratedTestScript 2016-12-05 20:21:21 +00:00
unittest-adaptor