[clang] Loosen check for clang version string in test to work when setting CLANG_VENDOR. (PR #192961)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 20 05:41:49 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: dyung
<details>
<summary>Changes</summary>
I am trying to update our buildbot to use the `-DCLANG_VENDOR` and `-DCLANG_VENDOR_UTI` options, but need to fix some tests first. This is one of them.
This test checks for the default version string, essentially when `CLANG_VENDOR` and `CLANG_VENDOR_UTI` are either not set or empty. If they are set, then the test fails as it checks from the very beginning of the line. I fixed this test by making it more flexible and only checking that the previous check occurs in the line, not necessarily at the beginning. This allows the test to pass in both the default case, and when the `CLANG_VENDOR` and `CLANG_VENDOR_UTI` options are utilized.
---
Full diff: https://github.com/llvm/llvm-project/pull/192961.diff
1 Files Affected:
- (modified) clang/bindings/python/tests/cindex/test_version.py (+1-1)
``````````diff
diff --git a/clang/bindings/python/tests/cindex/test_version.py b/clang/bindings/python/tests/cindex/test_version.py
index 2b25b0bd1c526..2f47b0b1aa56d 100755
--- a/clang/bindings/python/tests/cindex/test_version.py
+++ b/clang/bindings/python/tests/cindex/test_version.py
@@ -8,4 +8,4 @@ def test_get_version_format(self):
conf = Config()
version = conf.get_clang_version()
- self.assertRegex(version, r"^clang version \d+\.\d+\.\d+")
+ self.assertRegex(version, r"^(.*)*clang version \d+\.\d+\.\d+")
``````````
</details>
https://github.com/llvm/llvm-project/pull/192961
More information about the cfe-commits
mailing list