This change allows the conditions in lit test files (REQUIRES, XFAIL, UNSUPPORTED) to be boolean expressions.
The change is otherwise intended to preserve the behavior of existing conditions in test files. I verified that these test suites run unchanged on OS X: llvm; llvm-lit; swift; clang (after a small patch). Additional test coverage is appreciated.
A 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 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. (FIXME should this be changed?)
- All other identifiers are false.
- Identifiers are [-+=._a-zA-Z0-9]* . This allows all feature variable names used in llvm and clang and swift and libc++ today.