[PATCH] D18185: [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED

Greg Parker via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 07:20:37 PDT 2016


gparker42 created this revision.
gparker42 added a subscriber: llvm-commits.

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. 
For REQUIRES, if each expression is True then the test will run. 
For UNSUPPORTED, if each expression is False then the test will run. 
For XFAIL, if each expression is False then the test is expected to fail. As a special case "XFAIL: *" also expects the test to fail.
These are the same behaviors as the current comma-separated list of features and/or targets.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 and apple and not macosx
# Test is unsupported on Windows and non-Ubuntu Linux and supported everywhere else
UNSUPPORTED: linux and not ubuntu, system-windows

Syntax: 
* 'and', 'or', 'not', '(', ')'. '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-Z][-=:/_a-zA-Z0-9]* . This allows all feature variable names used in llvm and clang and swift today.


http://reviews.llvm.org/D18185

Files:
  utils/lit/lit/BooleanExpression.py
  utils/lit/lit/Test.py
  utils/lit/lit/TestRunner.py
  utils/lit/tests/Inputs/shtest-format/expr-bad-01.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-02.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-03.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-04.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-05.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-06.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-07.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-08.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-09.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-10.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-11.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-12.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-13.txt
  utils/lit/tests/Inputs/shtest-format/expr-bad-14.txt
  utils/lit/tests/Inputs/shtest-format/lit.cfg
  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-triple.txt
  utils/lit/tests/Inputs/shtest-format/unsupported-expr-false.txt
  utils/lit/tests/Inputs/shtest-format/unsupported-expr-true.txt
  utils/lit/tests/Inputs/shtest-format/xfail-expr-false.txt
  utils/lit/tests/Inputs/shtest-format/xfail-expr-true.txt
  utils/lit/tests/shtest-format.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18185.50724.patch
Type: text/x-patch
Size: 26957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160315/a1a724d8/attachment-0001.bin>


More information about the llvm-commits mailing list