From 7b7b90769ac1b1ed4ac3d506b57866d44130a36e Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 4 Mar 2010 09:36:50 +0000 Subject: 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 --- test/lit.cfg | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/lit.cfg') 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 -- cgit v1.2.3