brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · bd6d197 Raw
40 lines · python
1"""2Test more expression command sequences with objective-c.3"""4 5 6import lldb7from lldbsuite.test.decorators import *8from lldbsuite.test.lldbtest import *9from lldbsuite.test import lldbutil10 11 12class FoundationTestCase2(TestBase):13    NO_DEBUG_INFO_TESTCASE = True14 15    def test_expr_commands(self):16        """More expression commands for objective-c."""17        self.build()18        main_spec = lldb.SBFileSpec("main.m")19 20        (target, process, thread, bp) = lldbutil.run_to_source_breakpoint(21            self, "Break here for selector: tests", main_spec22        )23 24        # Test_Selector:25        self.expect(26            "expression (char *)sel_getName(sel)", substrs=["(char *)", "length"]27        )28 29        desc_bkpt = target.BreakpointCreateBySourceRegex(30            "Break here for description test", main_spec31        )32        self.assertEqual(33            desc_bkpt.GetNumLocations(), 1, "description breakpoint has a location"34        )35        lldbutil.continue_to_breakpoint(process, desc_bkpt)36 37        self.expect(38            "expression (char *)sel_getName(_cmd)", substrs=["(char *)", "description"]39        )40