[Lldb-commits] [lldb] [lldb] Fix: Disable shared build dir when testing with PDB (PR #190991)

via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 8 08:49:21 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Stefan Gränitz (weliveindetail)

<details>
<summary>Changes</summary>

In a [recent review](https://github.com/llvm/llvm-project/pull/187072#discussion_r2948459704) we found that the mechanism to disable `SHARED_BUILD_TESTCASE` for tests that set `TEST_WITH_PDB_DEBUG_INFO` doesn't work. It turns out that the object where we set the property in line 1989 is just a local variable. What we use eventually is the object that is newly constructed from the `newattrs` dict in the return statement of the `LLDBTestCaseFactory` metaclass constructor. This is where we have to set `SHARED_BUILD_TESTCASE` in order to take effect. I moved the assignment after the for-loop, because in line 1989 the dict doesn't exist yet.

---
Full diff: https://github.com/llvm/llvm-project/pull/190991.diff


2 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/lldbtest.py (+4-3) 
- (modified) lldb/test/API/symstore/TestSymStore.py (-1) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 919739dbcd1b4..f2a9f3bba1993 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1985,9 +1985,6 @@ def __new__(cls, name, bases, attrs):
         if original_testcase.NO_DEBUG_INFO_TESTCASE and not has_variant_tests:
             return original_testcase
 
-        if original_testcase.TEST_WITH_PDB_DEBUG_INFO:
-            original_testcase.SHARED_BUILD_TESTCASE = False
-
         # Default implementation for skip/xfail reason based on the debug category,
         # where "None" means to run the test as usual.
         def no_reason(*args, **kwargs):
@@ -2066,6 +2063,10 @@ def test_method(self, attrvalue=attrvalue):
 
             else:
                 newattrs[attrname] = attrvalue
+
+        if original_testcase.TEST_WITH_PDB_DEBUG_INFO:
+            newattrs["SHARED_BUILD_TESTCASE"] = False
+
         return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, newattrs)
 
 
diff --git a/lldb/test/API/symstore/TestSymStore.py b/lldb/test/API/symstore/TestSymStore.py
index 13d0cc1666c84..5d341dd70342b 100644
--- a/lldb/test/API/symstore/TestSymStore.py
+++ b/lldb/test/API/symstore/TestSymStore.py
@@ -91,7 +91,6 @@ def __exit__(self, *exc_info):
 
 
 class SymStoreTests(TestBase):
-    SHARED_BUILD_TESTCASE = False
     TEST_WITH_PDB_DEBUG_INFO = True
 
     def build_inferior(self):

``````````

</details>


https://github.com/llvm/llvm-project/pull/190991


More information about the lldb-commits mailing list