llvm.org GIT mirror llvm / 80c7e63
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307339 91177308-0d34-0410-b5e6-96231b3b80d8 George Karpenkov 2 years ago
3 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
167167 provided. The two options must be used together, and the value of ``N``
168168 must be in the range ``1..M``. The environment variable
169169 ``LIT_RUN_SHARD`` can also be used in place of this option.
170
171 .. option:: --filter=REGEXP
172
173 Run only those tests whose name matches the regular expression specified in
174 ``REGEXP``. The environment variable ``LIT_FILTER`` can be also used in place
175 of this option, which is especially useful in environments where the call
176 to ``lit`` is issued indirectly.
170177
171178 ADDITIONAL OPTIONS
172179 ------------------
261261 selection_group.add_argument("--filter", metavar="REGEX",
262262 help=("Only run tests with paths matching the given "
263263 "regular expression"),
264 action="store", default=None)
264 action="store",
265 default=os.environ.get("LIT_FILTER"))
265266 selection_group.add_argument("--num-shards", dest="numShards", metavar="M",
266267 help="Split testsuite into M pieces and only run one",
267268 action="store", type=int,
55 #
66 # RUN: %{lit} --filter 'o[a-z]e' %{inputs}/discovery | FileCheck --check-prefix=CHECK-FILTER %s
77 # CHECK-FILTER: Testing: 2 of 5 tests
8
9 # Check that regex-filtering based on environment variables work.
10 #
11 # RUN: LIT_FILTER='o[a-z]e' %{lit} %{inputs}/discovery | FileCheck --check-prefix=CHECK-FILTER-ENV %s
12 # CHECK-FILTER-ENV: Testing: 2 of 5 tests
813
914
1015 # Check that maximum counts work