| 1 |
""" |
| 2 |
Tests lldbutil's behavior when running to a source breakpoint fails. |
| 3 |
""" |
| 4 |
|
| 5 |
import lldb |
| 6 |
import lldbsuite.test.lldbutil as lldbutil |
| 7 |
from lldbsuite.test.lldbtest import * |
| 8 |
from lldbsuite.test.decorators import * |
| 9 |
|
| 10 |
|
| 11 |
class LLDBUtilFailedToHitBreakpointTest(TestBase): |
| 12 |
NO_DEBUG_INFO_TESTCASE = True |
| 13 |
|
| 14 |
@expectedFailureAll(oslist=["windows"]) |
| 15 |
def test_error_message(self): |
| 16 |
""" |
| 17 |
Tests that run_to_source_breakpoint prints the right error message |
| 18 |
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 |
) |