[Lldb-commits] [lldb] [lldb-dap] Migrate DAP launch tests (PR #207023)

Sergei Druzhkov via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 2 01:32:20 PDT 2026


================
@@ -2,22 +2,26 @@
 Test lldb-dap launch request.
 """
 
-import lldbdap_testcase
+from lldbsuite.test.tools.lldb_dap.dap_types import InitializedEvent, LaunchArgs
+from lldbsuite.test.tools.lldb_dap.lldb_dap_testcase import DAPTestCaseBase
 
 
-class TestDAP_launch_invalid_program(lldbdap_testcase.DAPTestCaseBase):
+class TestDAP_launch_invalid_program(DAPTestCaseBase):
     """
     Tests launching with an invalid program.
     """
 
     def test(self):
         program = self.getBuildArtifact("a.out")
-        self.create_debug_adapter()
-        launch_seq = self.launch(program)
-        self.dap_server.wait_for_initialized()
-        self.dap_server.request_configurationDone()
-        response = self.dap_server.receive_response(launch_seq)
-        self.assertFalse(response["success"])
-        self.assertEqual(
-            "'{0}' does not exist".format(program), response["body"]["error"]["format"]
+        session = self.create_session()
+        init_response = session.initialize_sequence(session.initialize_args)
+        launch_handle = session.send_request(LaunchArgs(program=program))
+        session.wait_for_event(InitializedEvent, after=init_response)
----------------
DrSergei wrote:

Can we use `session.ensure_initialized()` here?

https://github.com/llvm/llvm-project/pull/207023


More information about the lldb-commits mailing list