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