[Lldb-commits] [lldb] [lldb] Add a test for terminal dimensions (PR #126598)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 10 14:38:36 PST 2025
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/126598
>From 6a12b9282228b24691dfcd4d8ec4d2b240747f54 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Mon, 10 Feb 2025 12:58:00 -0800
Subject: [PATCH 1/2] [lldb] Add a test for terminal dimensions
Add a test for the term-width and term-height settings.
---
.../driver/terminal/TestTerminalDimensions.py | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 lldb/test/API/driver/terminal/TestTerminalDimensions.py
diff --git a/lldb/test/API/driver/terminal/TestTerminalDimensions.py b/lldb/test/API/driver/terminal/TestTerminalDimensions.py
new file mode 100644
index 000000000000000..264cfa5950bfd33
--- /dev/null
+++ b/lldb/test/API/driver/terminal/TestTerminalDimensions.py
@@ -0,0 +1,22 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+from lldbsuite.test.lldbpexpect import PExpectTest
+
+
+class TerminalDimensionsTest(PExpectTest):
+ NO_DEBUG_INFO_TESTCASE = True
+
+ @skipIfAsan
+ def test(self):
+ """Test that the lldb driver correctly reports the (PExpect) terminal dimension."""
+ self.launch(dimensions=(40, 40), timeout=1)
+
+ # Tests clear all the settings so we lose the launch values. Resize the
+ # window to update the settings. These new values need to be different
+ # to trigger a SIGWINCH.
+ self.child.setwinsize(20, 60)
+
+ self.expect("settings show term-height", ["term-height (unsigned) = 20"])
+ self.expect("settings show term-width", ["term-width (unsigned) = 60"])
>From e277b6e964305daafc4e561c3a78baac961149af Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Mon, 10 Feb 2025 14:38:23 -0800
Subject: [PATCH 2/2] Remove timeout
---
lldb/test/API/driver/terminal/TestTerminalDimensions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/test/API/driver/terminal/TestTerminalDimensions.py b/lldb/test/API/driver/terminal/TestTerminalDimensions.py
index 264cfa5950bfd33..9ab3745613994a6 100644
--- a/lldb/test/API/driver/terminal/TestTerminalDimensions.py
+++ b/lldb/test/API/driver/terminal/TestTerminalDimensions.py
@@ -11,7 +11,7 @@ class TerminalDimensionsTest(PExpectTest):
@skipIfAsan
def test(self):
"""Test that the lldb driver correctly reports the (PExpect) terminal dimension."""
- self.launch(dimensions=(40, 40), timeout=1)
+ self.launch(dimensions=(40, 40))
# Tests clear all the settings so we lose the launch values. Resize the
# window to update the settings. These new values need to be different
More information about the lldb-commits
mailing list