[llvm] 6351259 - [lit] fix a error when using --show-used-features
Yuanfang Chen via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 19 10:57:22 PDT 2022
Author: Yuanfang Chen
Date: 2022-10-19T10:57:01-07:00
New Revision: 63512592e97d0b452d9cd666dc09bd63e18b0828
URL: https://github.com/llvm/llvm-project/commit/63512592e97d0b452d9cd666dc09bd63e18b0828
DIFF: https://github.com/llvm/llvm-project/commit/63512592e97d0b452d9cd666dc09bd63e18b0828.diff
LOG: [lit] fix a error when using --show-used-features
The error is
```
NotADirectoryError: [Errno 20] Not a directory: '<build-dir>/unittests/Analysis/./AnalysisTests/0/40'
```
Exclude unittests when collecting features because
unittests don't make use of feature keywords.
Added:
Modified:
llvm/utils/lit/lit/main.py
Removed:
################################################################################
diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py
index 27bcef1b1d464..dc90321ddfc9f 100755
--- a/llvm/utils/lit/lit/main.py
+++ b/llvm/utils/lit/lit/main.py
@@ -53,7 +53,7 @@ def main(builtin_params={}):
sys.exit(0)
if opts.show_used_features:
- features = set(itertools.chain.from_iterable(t.getUsedFeatures() for t in discovered_tests))
+ features = set(itertools.chain.from_iterable(t.getUsedFeatures() for t in discovered_tests if t.gtest_json_file is None))
print(' '.join(sorted(features)))
sys.exit(0)
More information about the llvm-commits
mailing list