1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[lit] Modify LIT to accept environment variable LIT_FILTER to select tests.

This is especially useful when lit is invoked indirectly by the build
system, and additional arguments can not be easily specified.

Differential Revision: https://reviews.llvm.org/D35091

llvm-svn: 307339
This commit is contained in:
George Karpenkov 2017-07-07 00:22:11 +00:00
parent a3256711ec
commit e55b0ad210
3 changed files with 14 additions and 1 deletions

View File

@ -169,6 +169,13 @@ SELECTION OPTIONS
must be in the range ``1..M``. The environment variable
``LIT_RUN_SHARD`` can also be used in place of this option.
.. option:: --filter=REGEXP
Run only those tests whose name matches the regular expression specified in
``REGEXP``. The environment variable ``LIT_FILTER`` can be also used in place
of this option, which is especially useful in environments where the call
to ``lit`` is issued indirectly.
ADDITIONAL OPTIONS
------------------

View File

@ -262,7 +262,8 @@ def main_with_tmp(builtinParameters):
selection_group.add_argument("--filter", metavar="REGEX",
help=("Only run tests with paths matching the given "
"regular expression"),
action="store", default=None)
action="store",
default=os.environ.get("LIT_FILTER"))
selection_group.add_argument("--num-shards", dest="numShards", metavar="M",
help="Split testsuite into M pieces and only run one",
action="store", type=int,

View File

@ -7,6 +7,11 @@
# RUN: %{lit} --filter 'o[a-z]e' %{inputs}/discovery | FileCheck --check-prefix=CHECK-FILTER %s
# CHECK-FILTER: Testing: 2 of 5 tests
# Check that regex-filtering based on environment variables work.
#
# RUN: LIT_FILTER='o[a-z]e' %{lit} %{inputs}/discovery | FileCheck --check-prefix=CHECK-FILTER-ENV %s
# CHECK-FILTER-ENV: Testing: 2 of 5 tests
# Check that maximum counts work
#