28 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class TestCase(TestBase):8 def test(self):9 self.build()10 lldbutil.run_to_source_breakpoint(11 self, "break here", lldb.SBFileSpec("main.cpp")12 )13 14 self.dbg.HandleCommand(15 f"type summary add --expand -s 'some summary' SummaryAndChildren"16 )17 self.dbg.HandleCommand(f"type summary add -s 'some summary' SummaryOnly")18 19 self.expect(20 "v summary_and_children_ref", substrs=["some summary", "child = 30"]21 )22 self.expect(23 "v summary_only_ref", patterns=["some summary", "(?s)(?!.*child = )"]24 )25 self.expect(26 "v children_only_ref", patterns=["(?s)(?!.*some summary)", "child = 30"]27 )28