[Lldb-commits] [lldb] [lldb] Add test variants to build directory name (PR #222792)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 10 14:50:04 PDT 2026


https://github.com/kastiglione created https://github.com/llvm/llvm-project/pull/222792

None

>From 76f764ebf6688eea1a6a384049334b78a23b411b Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee.com at gmail.com>
Date: Thu, 10 Sep 2026 14:49:13 -0700
Subject: [PATCH] [lldb] Add test variants to build directory name

---
 lldb/packages/Python/lldbsuite/test/lldbtest.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 33ed383549032..bec50f806110b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -840,10 +840,20 @@ def getSourceDir(self):
 
     def getBuildDirBasename(self):
         if self.SHARED_BUILD_TESTCASE:
-            return self.__class__.__module__
+            return self.__class__.__module__ + self._getVariantSuffix()
         else:
             return self.__class__.__module__ + "." + self.testMethodName
 
+    def _getVariantSuffix(self) -> str:
+        """Return a suffix identifying the active build variants."""
+        parts = []
+        if debug_info := self.getDebugInfo():
+            parts.append(debug_info)
+        for variant in _test_variants:
+            if value := self.getVariant(variant.name):
+                parts.append(value)
+        return "." + "_".join(parts) if parts else ""
+
     def getBuildDir(self):
         """Return the full path to the current test."""
         return os.path.join(
@@ -2231,9 +2241,6 @@ 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)
 
 



More information about the lldb-commits mailing list