Skip to content

Commit ccdb719

Browse files
authored
[lldb] Fix a test if hardware breakpoints are not supported (llvm#168813)
If `HardwareBreakpointTestBase.supports_hw_breakpoints()` returns False, `SimpleHWBreakpointTest.does_not_support_hw_breakpoints()` returns None, so the test runs and fails. However, it should be skipped instead. The test was added in llvm#146602, while `supports_hw_breakpoints()` was changed in llvm#146609, which was landed earlier despite having a bigger number.
1 parent 66ddc9b commit ccdb719

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

lldb/test/API/functionalities/breakpoint/hardware_breakpoints/simple_hw_breakpoints/TestSimpleHWBreakpoints.py

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77

88

99
class SimpleHWBreakpointTest(HardwareBreakpointTestBase):
10-
def does_not_support_hw_breakpoints(self):
11-
# FIXME: Use HardwareBreakpointTestBase.supports_hw_breakpoints
12-
if super().supports_hw_breakpoints() is None:
13-
return "Hardware breakpoints are unsupported"
14-
return None
15-
16-
@skipTestIfFn(does_not_support_hw_breakpoints)
10+
@skipTestIfFn(HardwareBreakpointTestBase.hw_breakpoints_unsupported)
1711
def test(self):
1812
"""Test SBBreakpoint::SetIsHardware"""
1913
self.build()
@@ -35,16 +29,13 @@ def test(self):
3529
# breakpoint will be marked as a hardware breakpoint.
3630
self.assertTrue(break_on_me_bp.IsHardware())
3731

38-
if super().supports_hw_breakpoints():
39-
self.assertSuccess(error)
40-
41-
# Continue to our Hardware breakpoint and verify that's the reason
42-
# we're stopped.
43-
process.Continue()
44-
self.expect(
45-
"thread list",
46-
STOPPED_DUE_TO_BREAKPOINT,
47-
substrs=["stopped", "stop reason = breakpoint"],
48-
)
49-
else:
50-
self.assertFailure(error)
32+
self.assertSuccess(error)
33+
34+
# Continue to our Hardware breakpoint and verify that's the reason
35+
# we're stopped.
36+
process.Continue()
37+
self.expect(
38+
"thread list",
39+
STOPPED_DUE_TO_BREAKPOINT,
40+
substrs=["stopped", "stop reason = breakpoint"],
41+
)

0 commit comments

Comments
 (0)