[Lldb-commits] [lldb] [lldb] Add a test for terminal dimensions (PR #126598)

via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 10 12:59:46 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

Add a test for the term-width and term-height settings.

---
Full diff: https://github.com/llvm/llvm-project/pull/126598.diff


1 Files Affected:

- (added) lldb/test/API/driver/terminal/TestTerminalDimensions.py (+22) 


``````````diff
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"])

``````````

</details>


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


More information about the lldb-commits mailing list