diff options
author | John McCall <rjmccall@apple.com> | 2010-03-04 09:36:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-04 09:36:50 +0000 |
commit | 7b7b90769ac1b1ed4ac3d506b57866d44130a36e (patch) | |
tree | 4f9abd3332426176102df9608b1d198692c93690 /test/lit.cfg | |
parent | 5bf7f88ea28dae0cad4f311cc5ef708b6ce50e8f (diff) | |
download | llvm-7b7b90769ac1b1ed4ac3d506b57866d44130a36e.tar.gz llvm-7b7b90769ac1b1ed4ac3d506b57866d44130a36e.tar.bz2 llvm-7b7b90769ac1b1ed4ac3d506b57866d44130a36e.tar.xz |
Teach lit to honor conditional directives. The syntax is:
IF(condition(value)):
If the value satisfies the condition, the line is processed by lit; otherwise
it is skipped. A test with no unignored directives is resolved as Unsupported.
The test suite is responsible for defining conditions; conditions are unary
functions over strings. I've defined two conditions in the LLVM test suite,
TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values
like those in llvm_bindings). So for example you can write:
IF(BINDING(ocaml)): RUN: %blah %s -o -
and the RUN line will only execute if LLVM was configured with the ocaml
bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lit.cfg')
-rw-r--r-- | test/lit.cfg | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lit.cfg b/test/lit.cfg index 929871a1d2..b4aec5a50a 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -144,6 +144,9 @@ bindings = set(site_exp['llvm_bindings'].split(',')) def llvm_supports_binding(name): return name in bindings +config.conditions["TARGET"] = llvm_supports_target +config.conditions["BINDING"] = llvm_supports_binding + # Provide on_clone hook for reading 'dg.exp'. import os simpleLibData = re.compile(r"""load_lib llvm.exp |