28 lines · python
1"""2Tests lldbutil's behavior when running to a source breakpoint fails.3"""4 5import lldb6import lldbsuite.test.lldbutil as lldbutil7from lldbsuite.test.lldbtest import *8from lldbsuite.test.decorators import *9 10 11class LLDBUtilFailedToHitBreakpointTest(TestBase):12 NO_DEBUG_INFO_TESTCASE = True13 14 @expectedFailureAll(oslist=["windows"])15 def test_error_message(self):16 """17 Tests that run_to_source_breakpoint prints the right error message18 when failing to hit the wanted breakpoint.19 """20 self.build()21 with self.assertRaisesRegex(22 AssertionError,23 "Test process is not stopped at breakpoint: state: exited, exit code: 0, stdout: 'stdout_needlestderr_needle'",24 ):25 lldbutil.run_to_source_breakpoint(26 self, "// break here", lldb.SBFileSpec("main.cpp")27 )28