]> 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 08:45:50 +0000 (08:45 +0000)
committerGreg Parker <gparker@apple.com>
Tue, 24 Jan 2017 08:45:50 +0000 (08:45 +0000)
commitebc14fff5261b02bba8525db3eea2af2ba0a5754
tree31f2aced2941f51a62667afec2c0aa55ded39309
parentaeb6f08dc22af684eec3c868e042e6674644a859
[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@292896 91177308-0d34-0410-b5e6-96231b3b80d8
19 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-any-missing.txt [deleted file]
utils/lit/tests/Inputs/shtest-format/requires-any-present.txt [deleted file]
utils/lit/tests/Inputs/shtest-format/requires-any.txt [new file with mode: 0644]
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