8
8
from lldbsuite .test import lldbutil
9
9
10
10
11
- class LibcxxSpanDataFormatterTestCase (TestBase ):
11
+ class StdSpanDataFormatterTestCase (TestBase ):
12
12
def findVariable (self , name ):
13
13
var = self .frame ().FindVariable (name )
14
14
self .assertTrue (var .IsValid ())
@@ -44,11 +44,8 @@ def check_numbers(self, var_name):
44
44
self .expect_var_path (f"{ var_name } [3]" , type = "int" , value = "1234" )
45
45
self .expect_var_path (f"{ var_name } [4]" , type = "int" , value = "12345" )
46
46
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 ):
50
48
"""Test that std::span variables are formatted correctly when printed."""
51
- self .build ()
52
49
(self .target , process , thread , bkpt ) = lldbutil .run_to_source_breakpoint (
53
50
self , "break here" , lldb .SBFileSpec ("main.cpp" , False )
54
51
)
@@ -158,11 +155,14 @@ def test_with_run_command(self):
158
155
)
159
156
self .check_size ("nested" , 2 )
160
157
161
- @add_test_categories (["libc++" ])
162
158
@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 ):
164
165
"""Test that std::span is correctly formatted when passed by ref and ptr"""
165
- self .build ()
166
166
(self .target , process , thread , bkpt ) = lldbutil .run_to_source_breakpoint (
167
167
self , "Stop here to check by ref" , lldb .SBFileSpec ("main.cpp" , False )
168
168
)
@@ -173,3 +173,9 @@ def test_ref_and_ptr(self):
173
173
# The pointer should just show the right number of elements:
174
174
175
175
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