[llvm] [lit] Support GoogleTest test discovery through prefixes, too (PR #137423)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 17:21:24 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r HEAD~1...HEAD llvm/utils/lit/tests/Inputs/googletest-prefix/DummySubDir/test_one.py llvm/utils/lit/lit/formats/googletest.py llvm/utils/lit/lit/util.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- lit/formats/googletest.py 2025-04-26 00:14:49.000000 +0000
+++ lit/formats/googletest.py 2025-04-26 00:20:56.099064 +0000
@@ -54,11 +54,13 @@
source_path = testSuite.getSourcePath(path_in_suite)
for subdir in self.test_sub_dirs:
dir_path = os.path.join(source_path, subdir)
if not os.path.isdir(dir_path):
continue
- for fn in lit.util.listdir_files(dir_path, suffixes=self.test_suffixes, prefixes=self.test_prefixes):
+ for fn in lit.util.listdir_files(
+ dir_path, suffixes=self.test_suffixes, prefixes=self.test_prefixes
+ ):
# Discover the tests in this executable.
execpath = os.path.join(source_path, subdir, fn)
if execpath in self.seen_executables:
litConfig.warning(
"Skip adding %r since it has been added to the test pool"
``````````
</details>
https://github.com/llvm/llvm-project/pull/137423
More information about the llvm-commits
mailing list