Skip to content

Commit 7565ae6

Browse files
committed
[lldb][test][NFC] Refactor xfails in TestRequireHWBreakpoints.py
This file used a strange, multi-level setup where we skipped on a function we used for xfailing. Let's not do that, just skip the one test we care about. Also added a comment to explain how this file works. The tests *want* calls to fail when we ask for only hardware breaks but have none to use. If you don't know that, it all seems backwards.
1 parent 837bff1 commit 7565ae6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""
22
Test require hardware breakpoints.
3+
4+
Some of these tests require a target that does not have hardware breakpoints.
5+
So that we can check we fail when required to use them.
36
"""
47

58

@@ -12,10 +15,6 @@
1215

1316

1417
class BreakpointLocationsTestCase(HardwareBreakpointTestBase):
15-
@skipIf(oslist=["linux"], archs=["arm"])
16-
def supports_hw_breakpoints(self):
17-
return super().supports_hw_breakpoints()
18-
1918
def test_breakpoint(self):
2019
"""Test regular breakpoints when hardware breakpoints are required."""
2120
self.build()
@@ -27,7 +26,7 @@ def test_breakpoint(self):
2726
breakpoint = target.BreakpointCreateByLocation("main.c", 1)
2827
self.assertTrue(breakpoint.IsHardware())
2928

30-
@expectedFailureIfFn(supports_hw_breakpoints)
29+
@expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
3130
def test_step_range(self):
3231
"""Test stepping when hardware breakpoints are required."""
3332
self.build()
@@ -50,7 +49,7 @@ def test_step_range(self):
5049
"Could not create hardware breakpoint for thread plan" in error.GetCString()
5150
)
5251

53-
@expectedFailureIfFn(supports_hw_breakpoints)
52+
@expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
5453
def test_step_out(self):
5554
"""Test stepping out when hardware breakpoints are required."""
5655
self.build()
@@ -72,7 +71,7 @@ def test_step_out(self):
7271
"Could not create hardware breakpoint for thread plan" in error.GetCString()
7372
)
7473

75-
@expectedFailureIfFn(supports_hw_breakpoints)
74+
@expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
7675
def test_step_over(self):
7776
"""Test stepping over when hardware breakpoints are required."""
7877
self.build()
@@ -90,7 +89,9 @@ def test_step_over(self):
9089
substrs=["error: Could not create hardware breakpoint for thread plan."],
9190
)
9291

93-
@expectedFailureIfFn(supports_hw_breakpoints)
92+
# Was reported to sometimes pass on certain hardware.
93+
@skipIf(oslist=["linux"], archs=["arm"])
94+
@expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
9495
def test_step_until(self):
9596
"""Test stepping until when hardware breakpoints are required."""
9697
self.build()

0 commit comments

Comments
 (0)