[Lldb-commits] [lldb] 7565ae6 - [lldb][test][NFC] Refactor xfails in TestRequireHWBreakpoints.py

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 30 05:46:23 PST 2024


Author: David Spickett
Date: 2024-01-30T13:46:09Z
New Revision: 7565ae6eb99b6d3c5d83d04404a2df1b3785dbfe

URL: https://github.com/llvm/llvm-project/commit/7565ae6eb99b6d3c5d83d04404a2df1b3785dbfe
DIFF: https://github.com/llvm/llvm-project/commit/7565ae6eb99b6d3c5d83d04404a2df1b3785dbfe.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py b/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
index 6d7719af8d69..ae4f7ea071ed 100644
--- a/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
+++ b/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/TestRequireHWBreakpoints.py
@@ -1,5 +1,8 @@
 """
 Test require hardware breakpoints.
+
+Some of these tests require a target that does not have hardware breakpoints.
+So that we can check we fail when required to use them.
 """
 
 
@@ -12,10 +15,6 @@
 
 
 class BreakpointLocationsTestCase(HardwareBreakpointTestBase):
-    @skipIf(oslist=["linux"], archs=["arm"])
-    def supports_hw_breakpoints(self):
-        return super().supports_hw_breakpoints()
-
     def test_breakpoint(self):
         """Test regular breakpoints when hardware breakpoints are required."""
         self.build()
@@ -27,7 +26,7 @@ def test_breakpoint(self):
         breakpoint = target.BreakpointCreateByLocation("main.c", 1)
         self.assertTrue(breakpoint.IsHardware())
 
-    @expectedFailureIfFn(supports_hw_breakpoints)
+    @expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
     def test_step_range(self):
         """Test stepping when hardware breakpoints are required."""
         self.build()
@@ -50,7 +49,7 @@ def test_step_range(self):
             "Could not create hardware breakpoint for thread plan" in error.GetCString()
         )
 
-    @expectedFailureIfFn(supports_hw_breakpoints)
+    @expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
     def test_step_out(self):
         """Test stepping out when hardware breakpoints are required."""
         self.build()
@@ -72,7 +71,7 @@ def test_step_out(self):
             "Could not create hardware breakpoint for thread plan" in error.GetCString()
         )
 
-    @expectedFailureIfFn(supports_hw_breakpoints)
+    @expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
     def test_step_over(self):
         """Test stepping over when hardware breakpoints are required."""
         self.build()
@@ -90,7 +89,9 @@ def test_step_over(self):
             substrs=["error: Could not create hardware breakpoint for thread plan."],
         )
 
-    @expectedFailureIfFn(supports_hw_breakpoints)
+    # Was reported to sometimes pass on certain hardware.
+    @skipIf(oslist=["linux"], archs=["arm"])
+    @expectedFailureIfFn(HardwareBreakpointTestBase.supports_hw_breakpoints)
     def test_step_until(self):
         """Test stepping until when hardware breakpoints are required."""
         self.build()


        


More information about the lldb-commits mailing list