aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/lit/tests/boolean-parsing.py
diff options
context:
space:
mode:
authorGreg Parker <gparker@apple.com>2017-01-24 08:45:50 +0000
committerGreg Parker <gparker@apple.com>2017-01-24 08:45:50 +0000
commit2ab45201e767739ea07f257e05c4a0291297ce51 (patch)
treeaca13c9d4ae7183d88dfdb551994f1d6b6192db7 /llvm/utils/lit/tests/boolean-parsing.py
parent098ee2fe02e51ff1c5c07e9067810b401a2546a1 (diff)
downloadllvm-2ab45201e767739ea07f257e05c4a0291297ce51.zip
llvm-2ab45201e767739ea07f257e05c4a0291297ce51.tar.gz
llvm-2ab45201e767739ea07f257e05c4a0291297ce51.tar.bz2
[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
A `lit` condition line is now a comma-separated list of boolean expressions. Comma-separated expressions act as if each expression were on its own condition line: For REQUIRES, if every expression is true then the test will run. For UNSUPPORTED, if every expression is false then the test will run. For XFAIL, if every expression is false then the test is expected to succeed. As a special case "XFAIL: *" expects the test to fail. Examples: # Test is expected fail on 64-bit Apple simulators and pass everywhere else XFAIL: x86_64 && apple && !macosx # Test is unsupported on Windows and on non-Ubuntu Linux # and supported everywhere else UNSUPPORTED: linux && !ubuntu, system-windows Syntax: * '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false. * Each test feature is a true identifier. * Substrings of the target triple are true identifiers for UNSUPPORTED and XFAIL, but not for REQUIRES. (This matches the current behavior.) * All other identifiers are false. * Identifiers are [-+=._a-zA-Z0-9]+ Differential Revision: https://reviews.llvm.org/D18185 llvm-svn: 292896
Diffstat (limited to 'llvm/utils/lit/tests/boolean-parsing.py')
-rw-r--r--llvm/utils/lit/tests/boolean-parsing.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/utils/lit/tests/boolean-parsing.py b/llvm/utils/lit/tests/boolean-parsing.py
new file mode 100644
index 0000000..372a94d
--- /dev/null
+++ b/llvm/utils/lit/tests/boolean-parsing.py
@@ -0,0 +1,4 @@
+# Test the boolean expression parser
+# used for REQUIRES and UNSUPPORTED and XFAIL
+
+# RUN: %{python} -m lit.BooleanExpression