88from lldbsuite .test import lldbutil
99
1010
11- class LibcxxSpanDataFormatterTestCase (TestBase ):
11+ class StdSpanDataFormatterTestCase (TestBase ):
1212 def findVariable (self , name ):
1313 var = self .frame ().FindVariable (name )
1414 self .assertTrue (var .IsValid ())
@@ -44,11 +44,8 @@ def check_numbers(self, var_name):
4444 self .expect_var_path (f"{ var_name } [3]" , type = "int" , value = "1234" )
4545 self .expect_var_path (f"{ var_name } [4]" , type = "int" , value = "12345" )
4646
47- @add_test_categories (["libc++" ])
48- @skipIf (compiler = "clang" , compiler_version = ["<" , "11.0" ])
49- def test_with_run_command (self ):
47+ def do_test (self ):
5048 """Test that std::span variables are formatted correctly when printed."""
51- self .build ()
5249 (self .target , process , thread , bkpt ) = lldbutil .run_to_source_breakpoint (
5350 self , "break here" , lldb .SBFileSpec ("main.cpp" , False )
5451 )
@@ -158,11 +155,14 @@ def test_with_run_command(self):
158155 )
159156 self .check_size ("nested" , 2 )
160157
161- @add_test_categories (["libc++" ])
162158 @skipIf (compiler = "clang" , compiler_version = ["<" , "11.0" ])
163- def test_ref_and_ptr (self ):
159+ @add_test_categories (["libc++" ])
160+ def test_libcxx (self ):
161+ self .build (dictionary = {"USE_LIBCPP" : 1 })
162+ self .do_test ()
163+
164+ def do_test_ref_and_ptr (self ):
164165 """Test that std::span is correctly formatted when passed by ref and ptr"""
165- self .build ()
166166 (self .target , process , thread , bkpt ) = lldbutil .run_to_source_breakpoint (
167167 self , "Stop here to check by ref" , lldb .SBFileSpec ("main.cpp" , False )
168168 )
@@ -173,3 +173,9 @@ def test_ref_and_ptr(self):
173173 # The pointer should just show the right number of elements:
174174
175175 self .expect ("frame variable ptr" , patterns = ["ptr = 0x[0-9a-f]+ size=5" ])
176+
177+ @skipIf (compiler = "clang" , compiler_version = ["<" , "11.0" ])
178+ @add_test_categories (["libc++" ])
179+ def test_ref_and_ptr_libcxx (self ):
180+ self .build (dictionary = {"USE_LIBCPP" : 1 })
181+ self .do_test_ref_and_ptr ()
0 commit comments