[Lldb-commits] [lldb] [lldb] fix SourceManagerTestCase freeze (PR #118095)

via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 29 05:48:56 PST 2024


https://github.com/dlav-sc created https://github.com/llvm/llvm-project/pull/118095

Currently lldb testsuite requires some interactive input:

```
test_artificial_source_location (TestSourceManager.SourceManagerTestCase)
There is a running process, kill it and restart?: [Y/n]
```

This patch sets lldb auto-confirm flag to true before SourceManagerTestCase start, so the test doesn't freeze now.

>From 701bb371f289620bb9c0da7de7d7bae8a09293b9 Mon Sep 17 00:00:00 2001
From: Daniil Avdeev <daniil.avdeev at syntacore.com>
Date: Mon, 29 Jul 2024 12:14:22 +0000
Subject: [PATCH] [lldb] fix SourceManagerTestCase freeze

Currently lldb testsuite requires some interactive input:
```
test_artificial_source_location (TestSourceManager.SourceManagerTestCase)
There is a running process, kill it and restart?: [Y/n]
```

This patch sets lldb auto-confirm flag to true before SourceManagerTestCase
start, so this test doesn't freeze now.
---
 lldb/test/API/source-manager/TestSourceManager.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lldb/test/API/source-manager/TestSourceManager.py b/lldb/test/API/source-manager/TestSourceManager.py
index ad7c85aac70eaf..6c15f69118a194 100644
--- a/lldb/test/API/source-manager/TestSourceManager.py
+++ b/lldb/test/API/source-manager/TestSourceManager.py
@@ -37,6 +37,9 @@ def setUp(self):
         # Find the line number to break inside main().
         self.file = self.getBuildArtifact("main-copy.c")
         self.line = line_number("main.c", "// Set break point at this line.")
+        # disable "There is a running process, kill it and restart?" prompt
+        self.runCmd("settings set auto-confirm true")
+        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
 
     def modify_content(self):
         # Read the main.c file content.



More information about the lldb-commits mailing list