https://github.com/charles-zablit updated 
https://github.com/llvm/llvm-project/pull/202688

>From 385f55a21a7468a982606876ab58e6a00bc62885 Mon Sep 17 00:00:00 2001
From: Charles Zablit <[email protected]>
Date: Tue, 9 Jun 2026 17:08:44 +0100
Subject: [PATCH] [lldb][Windows] extend @skipIfWindows to lldb-server or in
 process

---
 .../Python/lldbsuite/test/decorators.py       | 44 +++++++++++++++++++
 .../platform/connect/TestPlatformConnect.py   |  4 +-
 .../TestBreakpointCommand.py                  |  2 +-
 .../TestBreakpointLocations.py                |  2 +-
 .../TestDelayedBreakpoint.py                  |  2 +-
 .../TestFrameProviderCircularDependency.py    |  4 +-
 6 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 134591d3a5c67..43a5a1561563c 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -676,6 +676,36 @@ def expectedFailureWindows(bugnumber=None):
     return expectedFailureOS(["windows"], bugnumber)
 
 
+def _usingLLDBServerOnWindows():
+    """Return True if Windows tests should drive lldb-server instead of the
+    in-process Win32 ``windows`` process plugin.
+
+    The choice is controlled by the ``LLDB_USE_LLDB_SERVER`` environment
+    variable: unset/off selects the default in-process plugin, on selects
+    the gdb-remote path through ``lldb-server``.
+    """
+    return os.environ.get("LLDB_USE_LLDB_SERVER", "").lower() in (
+        "on",
+        "yes",
+        "1",
+        "true",
+    )
+
+
+def expectedFailureWindowsAndLLDBServer(bugnumber=None):
+    """Mark a test as xfail on Windows when driving lldb-server."""
+    if not _usingLLDBServerOnWindows():
+        return lambda func: func
+    return expectedFailureOS(["windows"], bugnumber)
+
+
+def expectedFailureWindowsAndNoLLDBServer(bugnumber=None):
+    """Mark a test as xfail on Windows when using the in-process plugin."""
+    if _usingLLDBServerOnWindows():
+        return lambda func: func
+    return expectedFailureOS(["windows"], bugnumber)
+
+
 # TODO: This decorator does not do anything. Remove it.
 def expectedFlakey(expected_fn, bugnumber=None):
     def expectedFailure_impl(func):
@@ -916,6 +946,20 @@ def version_check():
     return decorator
 
 
+def skipIfWindowsAndLLDBServer(func):
+    """Skip tests on Windows when driving lldb-server."""
+    if not _usingLLDBServerOnWindows():
+        return func
+    return skipIfPlatform(["windows"])(func)
+
+
+def skipIfWindowsAndNoLLDBServer(func):
+    """Skip tests on Windows when using the in-process plugin."""
+    if _usingLLDBServerOnWindows():
+        return func
+    return skipIfPlatform(["windows"])(func)
+
+
 def skipIfWindowsAndNonEnglish(func):
     """Decorate the item to skip tests that should be skipped on non-English 
locales on Windows."""
 
diff --git a/lldb/test/API/commands/platform/connect/TestPlatformConnect.py 
b/lldb/test/API/commands/platform/connect/TestPlatformConnect.py
index 0f9a51e216215..3f8d81c3ab897 100644
--- a/lldb/test/API/commands/platform/connect/TestPlatformConnect.py
+++ b/lldb/test/API/commands/platform/connect/TestPlatformConnect.py
@@ -13,7 +13,7 @@ class TestPlatformProcessConnect(TestBase):
     @skipIfRemote
     @expectedFailureAll(hostoslist=["windows"], triple=".*-android")
     @skipIfDarwin  # lldb-server not found correctly
-    @expectedFailureAll(oslist=["windows"])  # process modules not loaded
+    @expectedFailureWindowsAndNoLLDBServer()  # process modules not loaded
     # lldb-server platform times out waiting for the gdbserver port number to 
be
     # written to the pipe, yet it seems the gdbserver already has written it.
     @expectedFailureAll(
@@ -62,7 +62,7 @@ def test_platform_process_connect(self):
     @skipIfRemote
     @expectedFailureAll(hostoslist=["windows"], triple=".*-android")
     @skipIfDarwin  # lldb-server not found correctly
-    @expectedFailureAll(oslist=["windows"])  # process modules not loaded
+    @expectedFailureWindowsAndNoLLDBServer()  # process modules not loaded
     # lldb-server platform times out waiting for the gdbserver port number to 
be
     # written to the pipe, yet it seems the gdbserver already has written it.
     @expectedFailureAll(
diff --git 
a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
 
b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index 6139584c1b0d9..3ad65a202ad83 100644
--- 
a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ 
b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -16,7 +16,7 @@ class BreakpointCommandTestCase(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
     SHARED_BUILD_TESTCASE = False
 
-    @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
+    @expectedFailureWindowsAndNoLLDBServer(bugnumber="llvm.org/pr24528")
     def test_breakpoint_command_sequence(self):
         """Test a sequence of breakpoint command add, list, and delete."""
         self.build()
diff --git 
a/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
 
b/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
index 6ed3c902f79e3..4c8c90bc81f97 100644
--- 
a/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
+++ 
b/lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
@@ -10,7 +10,7 @@
 
 
 class BreakpointLocationsTestCase(TestBase):
-    @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
+    @expectedFailureWindowsAndNoLLDBServer(bugnumber="llvm.org/pr24528")
     def test_enable(self):
         """Test breakpoint enable/disable for a breakpoint ID with multiple 
locations."""
         self.build()
diff --git 
a/lldb/test/API/functionalities/breakpoint/delayed_breakpoints/TestDelayedBreakpoint.py
 
b/lldb/test/API/functionalities/breakpoint/delayed_breakpoints/TestDelayedBreakpoint.py
index a3709fd62a202..2d5da3f672729 100644
--- 
a/lldb/test/API/functionalities/breakpoint/delayed_breakpoints/TestDelayedBreakpoint.py
+++ 
b/lldb/test/API/functionalities/breakpoint/delayed_breakpoints/TestDelayedBreakpoint.py
@@ -5,7 +5,7 @@
 import os
 
 
-@skipIfWindows
+@skipIfWindowsAndNoLLDBServer
 class TestDelayedBreakpoint(TestBase):
     def test(self):
         self.build()
diff --git 
a/lldb/test/API/functionalities/scripted_frame_provider/circular_dependency/TestFrameProviderCircularDependency.py
 
b/lldb/test/API/functionalities/scripted_frame_provider/circular_dependency/TestFrameProviderCircularDependency.py
index dcba03e0413a2..87a30c150e4e3 100644
--- 
a/lldb/test/API/functionalities/scripted_frame_provider/circular_dependency/TestFrameProviderCircularDependency.py
+++ 
b/lldb/test/API/functionalities/scripted_frame_provider/circular_dependency/TestFrameProviderCircularDependency.py
@@ -47,7 +47,7 @@ def launch_and_stop_at_breakpoint(self):
         return target, thread
 
     @expectedFailureAll(oslist=["linux"], archs=["arm$"])
-    @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
+    @expectedFailureWindowsAndNoLLDBServer(bugnumber="llvm.org/pr24778")
     def test_circular_dependency_with_function_replacement(self):
         """
         Test the circular dependency fix with a provider that replaces 
function names.
@@ -165,7 +165,7 @@ def test_circular_dependency_handle_command_in_init(self):
                 frame.GetFunctionName(), f"Frame {i} should have function name"
             )
 
-    @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
+    @expectedFailureWindowsAndNoLLDBServer(bugnumber="llvm.org/pr24778")
     def test_circular_dependency_evaluate_expression_in_get_frame(self):
         """
         Test that calling EvaluateExpression in get_frame_at_index doesn't

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to