Skip to content

[lldb] Add a test for terminal dimensions #126598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions lldb/test/API/driver/terminal/TestTerminalDimensions.py
Original file line number Diff line number Diff line change
@@ -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))

# 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"])