[Lldb-commits] [lldb] 1c5d702 - [lldb-dap] Fix DAP_launch_io.py Test (#179295)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 3 11:58:58 PST 2026
Author: Ebuka Ezike
Date: 2026-02-03T19:58:52Z
New Revision: 1c5d70217561176cbb62d96ceae4aa49d92d2509
URL: https://github.com/llvm/llvm-project/commit/1c5d70217561176cbb62d96ceae4aa49d92d2509
DIFF: https://github.com/llvm/llvm-project/commit/1c5d70217561176cbb62d96ceae4aa49d92d2509.diff
LOG: [lldb-dap] Fix DAP_launch_io.py Test (#179295)
DAP_launch_io sends a continue request for a nonstopped process. Use
verify_process_exited instead.
Added:
Modified:
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection.py
lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py
lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
index 9f4780f5d9733..f3c16bd849a48 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
@@ -480,6 +480,9 @@ def continue_to_exception_breakpoint(
def continue_to_exit(self, exitCode=0):
self.do_continue()
+ self.verify_process_exited(exitCode)
+
+ def verify_process_exited(self, exitCode: int = 0):
stopped_events = self.dap_server.wait_for_stopped()
self.assertEqual(
len(stopped_events), 1, "stopped_events = {}".format(stopped_events)
diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection.py
index 8f36c509b3873..81501702624be 100644
--- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection.py
+++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection.py
@@ -16,8 +16,8 @@ def test(self):
program = self.getBuildArtifact("a.out")
with tempfile.NamedTemporaryFile("rt") as f:
- self.launch(program, stdio=[None, f.name])
- self.continue_to_exit()
+ self.launch_and_configurationDone(program, stdio=[None, f.name])
+ self.verify_process_exited()
lines = f.readlines()
self.assertIn(
program, lines[0], "make sure program path is in first argument"
diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py
index 5f60daf026473..0ed8a5e11bf8b 100644
--- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py
+++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py
@@ -29,10 +29,10 @@ def test(self):
program = self.getBuildArtifact("a.out")
with tempfile.NamedTemporaryFile("rt") as f:
- self.launch(
+ self.launch_and_configurationDone(
program, console="integratedTerminal", stdio=[None, f.name, None]
)
- self.continue_to_exit()
+ self.verify_process_exited()
lines = f.readlines()
self.assertIn(
program, lines[0], "make sure program path is in first argument"
diff --git a/lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io.py b/lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io.py
index bbd84c07d1d4f..f6cc1589cb71c 100644
--- a/lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io.py
+++ b/lldb/test/API/tools/lldb-dap/launch/io/TestDAP_launch_io.py
@@ -46,13 +46,13 @@ def all_redirection(self, console: str, with_args: bool = False):
) as stdout, NamedTemporaryFile("rt") as stderr:
stdin.write(input_text)
stdin.flush()
- self.launch(
+ self.launch_and_configurationDone(
program,
stdio=[stdin.name, stdout.name, stderr.name],
console=console,
args=program_args,
)
- self.continue_to_exit()
+ self.verify_process_exited()
all_stdout = stdout.read()
all_stderr = stderr.read()
@@ -82,8 +82,10 @@ def stdin_redirection(self, console: str, with_args: bool = False):
with NamedTemporaryFile("w+t") as stdin:
stdin.write(input_text)
stdin.flush()
- self.launch(program, stdio=[stdin.name], console=console, args=program_args)
- self.continue_to_exit()
+ self.launch_and_configurationDone(
+ program, stdio=[stdin.name], console=console, args=program_args
+ )
+ self.verify_process_exited()
stdout_text = self._get_debuggee_stdout()
stderr_text = self._get_debuggee_stderr()
@@ -111,14 +113,14 @@ def stdout_redirection(self, console: str, with_env: bool = False):
env = {"FROM_ENV": env_text} if with_env else {}
with NamedTemporaryFile("rt") as stdout:
- self.launch(
+ self.launch_and_configurationDone(
program,
stdio=[None, stdout.name],
console=console,
args=program_args,
env=env,
)
- self.continue_to_exit()
+ self.verify_process_exited()
# check stdout
stdout_text = stdout.read()
@@ -172,14 +174,14 @@ def stderr_redirection(self, console: str, with_env: bool = False):
env = {"FROM_ENV": env_text} if with_env else {}
with NamedTemporaryFile("rt") as stderr:
- self.launch(
+ self.launch_and_configurationDone(
program,
stdio=[None, None, stderr.name],
console=console,
args=program_args,
env=env,
)
- self.continue_to_exit()
+ self.verify_process_exited()
stdout_text = self._get_debuggee_stdout()
stderr_text = stderr.read()
if with_env:
More information about the lldb-commits
mailing list