[Lldb-commits] [lldb] af3ee62 - [lldb][lldb-dap][test] Enable more attach tests on Windows

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 28 09:53:30 PDT 2024


Author: David Spickett
Date: 2024-08-28T16:51:45Z
New Revision: af3ee626a396aa9ac9480131f48f6ebe2f6664c1

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

LOG: [lldb][lldb-dap][test] Enable more attach tests on Windows

By adding the equivalent includes.

Added: 
    

Modified: 
    lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
    lldb/test/API/tools/lldb-dap/attach/main.c

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
index 1dbe00144f3520..2df191cf0ae715 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
@@ -39,7 +39,6 @@ def set_and_hit_breakpoint(self, continueToExit=True):
         if continueToExit:
             self.continue_to_exit()
 
-    @skipIfWindows
     @skipIfNetBSD  # Hangs on NetBSD as well
     def test_by_pid(self):
         """
@@ -56,7 +55,6 @@ def test_by_pid(self):
         self.attach(pid=self.process.pid)
         self.set_and_hit_breakpoint(continueToExit=True)
 
-    @skipIfWindows
     @skipIfNetBSD  # Hangs on NetBSD as well
     def test_by_name(self):
         """
@@ -116,7 +114,6 @@ def test_by_name_waitFor(self):
         self.attach(program=program, waitFor=True)
         self.set_and_hit_breakpoint(continueToExit=True)
 
-    @skipIfWindows
     @skipIfDarwin
     @skipIfNetBSD  # Hangs on NetBSD as well
     @skipIf(
@@ -207,7 +204,6 @@ def test_commands(self):
         self.verify_commands("exitCommands", output, exitCommands)
         self.verify_commands("terminateCommands", output, terminateCommands)
 
-    @skipIfWindows
     @skipIfDarwin
     @skipIfNetBSD  # Hangs on NetBSD as well
     @skipIf(

diff  --git a/lldb/test/API/tools/lldb-dap/attach/main.c b/lldb/test/API/tools/lldb-dap/attach/main.c
index 64d86583ada697..c0b128afe445aa 100644
--- a/lldb/test/API/tools/lldb-dap/attach/main.c
+++ b/lldb/test/API/tools/lldb-dap/attach/main.c
@@ -1,5 +1,10 @@
 #include <stdio.h>
+#ifdef _WIN32
+#include <process.h>
+#include <windows.h>
+#else
 #include <unistd.h>
+#endif
 
 int main(int argc, char const *argv[]) {
   lldb_enable_attach();
@@ -15,6 +20,10 @@ int main(int argc, char const *argv[]) {
   }
 
   printf("pid = %i\n", getpid());
+#ifdef _WIN32
+  Sleep(10 * 1000);
+#else
   sleep(10);
+#endif
   return 0; // breakpoint 1
 }


        


More information about the lldb-commits mailing list