Author: Michael Buch
Date: 2026-03-05T11:07:40Z
New Revision: fcf6bb8f3ce692c84b8cea6d55696c8576151abd

URL: 
https://github.com/llvm/llvm-project/commit/fcf6bb8f3ce692c84b8cea6d55696c8576151abd
DIFF: 
https://github.com/llvm/llvm-project/commit/fcf6bb8f3ce692c84b8cea6d55696c8576151abd.diff

LOG: [lldb][test] Clean up USE_LIBSTDCPP/USE_LIBCPP usage

This patch makes the two tests consistent with the rest of the formatter API 
tests (and is in my opionion easier to follow).

Added: 
    

Modified: 
    
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
    
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py

Removed: 
    


################################################################################
diff  --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
index 98000036eebe7..00eba10a40a49 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
@@ -2,14 +2,11 @@
 Test lldb data formatter subsystem for bitset for libcxx and libstdcpp.
 """
 
-
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
-USE_LIBSTDCPP = "USE_LIBSTDCPP"
-USE_LIBCPP = "USE_LIBCPP"
 VALUE = "VALUE"
 REFERENCE = "REFERENCE"
 POINTER = "POINTER"
@@ -53,10 +50,8 @@ def check(self, name, size, variant):
             name, type=self.getBitsetVariant(size, variant), children=children
         )
 
-    def do_test_value(self, stdlib_type):
+    def do_test_value(self):
         """Test that std::bitset is displayed correctly"""
-        self.build(dictionary={stdlib_type: "1"})
-
         lldbutil.run_to_source_breakpoint(
             self, "// break here", lldb.SBFileSpec("main.cpp", False)
         )
@@ -68,16 +63,16 @@ def do_test_value(self, stdlib_type):
 
     @add_test_categories(["libstdcxx"])
     def test_value_libstdcpp(self):
-        self.do_test_value(USE_LIBSTDCPP)
+        self.build(dictionary={"USE_LIBSTDCPP": 1})
+        self.do_test_value()
 
     @add_test_categories(["libc++"])
     def test_value_libcpp(self):
-        self.do_test_value(USE_LIBCPP)
+        self.build(dictionary={"USE_LIBCPP": 1})
+        self.do_test_value()
 
-    def do_test_ptr_and_ref(self, stdlib_type):
+    def do_test_ptr_and_ref(self):
         """Test that ref and ptr to std::bitset is displayed correctly"""
-        self.build(dictionary={stdlib_type: "1"})
-
         (_, process, _, bkpt) = lldbutil.run_to_source_breakpoint(
             self, "Check ref and ptr", lldb.SBFileSpec("main.cpp", False)
         )
@@ -97,8 +92,10 @@ def do_test_ptr_and_ref(self, stdlib_type):
 
     @add_test_categories(["libstdcxx"])
     def test_ptr_and_ref_libstdcpp(self):
-        self.do_test_ptr_and_ref(USE_LIBSTDCPP)
+        self.build(dictionary={"USE_LIBSTDCPP": 1})
+        self.do_test_ptr_and_ref()
 
     @add_test_categories(["libc++"])
     def test_ptr_and_ref_libcpp(self):
-        self.do_test_ptr_and_ref(USE_LIBCPP)
+        self.build(dictionary={"USE_LIBCPP": 1})
+        self.do_test_ptr_and_ref()

diff  --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py
index 54bb661057cd6..8a79b59e871af 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py
@@ -2,20 +2,15 @@
 Test lldb data formatter subsystem.
 """
 
-
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
-USE_LIBSTDCPP = "USE_LIBSTDCPP"
-USE_LIBCPP = "USE_LIBCPP"
-
 
 class TestCoroutineHandle(TestBase):
-    def do_test(self, stdlib_type):
+    def do_test(self):
         """Test std::coroutine_handle is displayed correctly."""
-        self.build(dictionary={stdlib_type: "1"})
         is_clang = self.expectedCompiler(["clang"])
 
         # Clang <= 20 used to also name the resume/destroy functions
@@ -167,9 +162,11 @@ def do_test(self, stdlib_type):
 
     @add_test_categories(["libstdcxx"])
     def test_libstdcpp(self):
-        self.do_test(USE_LIBSTDCPP)
+        self.build(dictionary={"USE_LIBSTDCPP": 1})
+        self.do_test()
 
     @add_test_categories(["libc++"])
     @skipIf(compiler="clang", compiler_version=["<", "15.0"])
     def test_libcpp(self):
-        self.do_test(USE_LIBCPP)
+        self.build(dictionary={"USE_LIBCPP": 1})
+        self.do_test()


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to