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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307339
91177308-0d34-0410-b5e6-
96231b3b80d8
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
------------------
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,
# 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
#