llvm-project/llvm
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
..
bindings Fix go binding to adapt the new attribute API 2016-11-18 10:11:02 +00:00
cmake [CMake] Fix symlink refactor for multi-configuration generators 2016-12-05 17:02:11 +00:00
docs [doc] Add .arcconfig setup to the "how to work with a monorepo" section 2016-12-03 01:04:40 +00:00
examples ExceptionDemo: remove some undefined behaviour 2016-11-20 02:36:38 +00:00
include [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
lib [AArch64][RegisterBankInfo] Fix typo in the logic used in assert. 2016-12-05 19:02:37 +00:00
projects
resources
runtimes [CMake] Make the runtimes directory work with bootstrap builds 2016-10-19 21:50:25 +00:00
test [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
tools Always use / as the path separator. 2016-12-04 07:27:02 +00:00
unittests [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
utils [lit] Support custom parsers in parseIntegratedTestScript 2016-12-05 20:21:21 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning 2016-12-05 05:21:44 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take ownership of IR Linker as discussed on llvm-dev 2016-12-02 14:06:53 +00:00
CREDITS.TXT Test Commit, removing a blank line in CREDITS.TXT 2016-11-24 15:40:19 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Test commit, deleted empty line at the end of README.txt 2016-11-07 18:31:21 +00:00
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.