llvm/utils/lit/tests
Eric Fiselier 5b9f351e17 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 20:21:21 +00:00
..
Inputs [lit] Support custom parsers in parseIntegratedTestScript 2016-12-05 20:21:21 +00:00
unit [lit] Support custom parsers in parseIntegratedTestScript 2016-12-05 20:21:21 +00:00
.coveragerc
discovery.py [LIT] Fix discovery.py test once again 2015-07-21 04:25:13 +00:00
googletest-format.py [lit] Add test coverage of gtest format. 2013-08-14 22:21:11 +00:00
googletest-timeout.py [lit] Implement support of per test timeout in lit. 2015-12-27 14:03:49 +00:00
googletest-upstream-format.py [lit][googletest] Handle upstream gtest output 2016-03-31 18:22:55 +00:00
lit.cfg Revert "Teach the CMake build system to run lit's test suite. These can be run" 2016-01-09 21:42:57 +00:00
max-failures.py [lit] Add a --max-failures option. 2016-09-26 23:38:23 +00:00
progress-bar.py
shell-parsing.py [lit] Fix tests to execute lit with same python as invoked with. 2013-08-14 05:07:09 +00:00
shtest-encoding.py [lit] Support parsing scripts with inconsistent or invalid encodings. 2013-08-14 18:22:41 +00:00
shtest-format.py [lit] Improve readability of failing scripts. 2016-06-02 23:49:42 +00:00
shtest-output-printing.py [lit] Improve logging with file redirection. 2016-06-07 16:13:40 +00:00
shtest-shell.py [lit] Improve logging with file redirection. 2016-06-07 16:13:40 +00:00
shtest-timeout.py [lit] Fix test shtest-timeout.py for modern output 2016-10-12 21:40:08 +00:00
test-data.py [lit] Add support for attach arbitrary metrics to test results. 2013-09-11 17:45:11 +00:00
test-output.py Require python 2.7. 2014-12-12 15:29:31 +00:00
unittest-adaptor.py [LIT] Fix failing LIT tests 2015-06-13 06:55:44 +00:00
usage.py [lit] Use argparse instead of optparse 2016-10-03 22:12:42 +00:00
xunit-output.py [LIT] Fix failing LIT tests 2015-06-13 06:55:44 +00:00