xref: /llvm-project/lldb/test/API/lang/objc/objc-new-syntax/ObjCNewSyntaxTest.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
199451b44SJordan Rupprecht"""Test that the Objective-C syntax for dictionary/array literals and indexing works"""
299451b44SJordan Rupprecht
399451b44SJordan Rupprechtimport lldb
499451b44SJordan Rupprechtfrom lldbsuite.test.decorators import *
599451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import *
699451b44SJordan Rupprechtfrom lldbsuite.test import lldbutil
799451b44SJordan Rupprecht
899451b44SJordan Rupprecht
999451b44SJordan Rupprechtclass ObjCNewSyntaxTest(TestBase):
1008c0a45aSAdrian Prantl    def target(self):
115cf23eccSAdrian Prantl        return self._target
1208c0a45aSAdrian Prantl
1399451b44SJordan Rupprecht    def runToBreakpoint(self):
1499451b44SJordan Rupprecht        self.build()
1508c0a45aSAdrian Prantl        self._target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
16*2238dcc3SJonas Devlieghere            self, "// Set breakpoint 0 here.", lldb.SBFileSpec("main.m", False)
17*2238dcc3SJonas Devlieghere        )
1899451b44SJordan Rupprecht
1999451b44SJordan Rupprecht        # The stop reason of the thread should be breakpoint.
2099451b44SJordan Rupprecht        self.expect(
2199451b44SJordan Rupprecht            "thread list",
2299451b44SJordan Rupprecht            STOPPED_DUE_TO_BREAKPOINT,
23*2238dcc3SJonas Devlieghere            substrs=["stopped", "stop reason = breakpoint"],
24*2238dcc3SJonas Devlieghere        )
2599451b44SJordan Rupprecht
2699451b44SJordan Rupprecht        # The breakpoint should have a hit count of 1.
279f0b5f9aSSYNOPSYS\georgiev        lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
28