[llvm] [lit] Add --filter-requires to select tests by required features (PR #221873)
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 03:04:50 PDT 2026
================
@@ -456,6 +457,18 @@ def parse_args():
help="Filter out tests with paths matching the given regular expression",
default=os.environ.get("LIT_FILTER_OUT", "^$"),
)
+ selection_group.add_argument(
+ "--filter-requires",
+ metavar="EXPR",
+ type=_requires_filter,
+ help="Select REQUIRES combinations with exactly the requested "
+ "positive features and no unrequested exclusions. Supports &&, ||, !, "
+ "parentheses, and commas (AND), not regexes or wildcards. Feature names "
+ "are case-sensitive. Base selects tests with no REQUIRES entries. "
+ "Bypasses REQUIRES feature availability checks; "
+ "the caller must schedule on capable devices. Nonmatching tests are "
+ "excluded. WTT reports also omit unsupported tests in filtered runs.",
----------------
DavidSpickett wrote:
If it's correct to think about `--filter-requires` as "only attempt to run these tests", then there is an argument to not mention the excluded tests at all. Given that they were not skipped by lit, and we never checked if they were unsupported.
But if we don't mention them, we can't audit what the filter did. Perhaps you could attach a skip reason to them? "Skipped (due to --filter-requires)"?
https://github.com/llvm/llvm-project/pull/221873
More information about the llvm-commits
mailing list