]> granicus.if.org Git - llvm/commit
[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
authorGreg Parker <gparker@apple.com>
Tue, 24 Jan 2017 09:58:02 +0000 (09:58 +0000)
committerGreg Parker <gparker@apple.com>
Tue, 24 Jan 2017 09:58:02 +0000 (09:58 +0000)
commit7664071405d5207ca85ec3ba2e65ae6e20f91267
treee30ecd590c6c6e9c49bfa9204afc98efa98e1fc5
parent288f4223ce23de4735d18541217d58d572133d55
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292904 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
docs/TestingGuide.rst
utils/lit/lit/BooleanExpression.py [new file with mode: 0644]
utils/lit/lit/Test.py
utils/lit/lit/TestRunner.py
utils/lit/tests/Inputs/shtest-format/requires-missing.txt
utils/lit/tests/Inputs/shtest-format/requires-present.txt
utils/lit/tests/Inputs/shtest-format/requires-star.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-format/requires-triple.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-format/unsupported-expr-false.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-format/unsupported-expr-true.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-format/unsupported-star.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-format/xfail-expr-false.txt [new file with mode: 0644]
utils/lit/tests/Inputs/shtest-format/xfail-expr-true.txt [new file with mode: 0644]
utils/lit/tests/boolean-parsing.py [new file with mode: 0644]
utils/lit/tests/shtest-format.py
utils/lit/tests/unit/TestRunner.py