]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.python/tui-window.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.python / tui-window.exp
CommitLineData
213516ef 1# Copyright (C) 2020-2023 Free Software Foundation, Inc.
01b1af32
TT
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16# Test a TUI window implemented in Python.
17
18load_lib gdb-python.exp
8c74a764 19tuiterm_env
01b1af32
TT
20
21# This test doesn't care about the inferior.
22standard_testfile py-arch.c
23
24if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
25 return -1
26}
27
90d7916a
TV
28clean_restart
29if {[skip_tui_tests]} {
30 return
31}
32
01b1af32
TT
33Term::clean_restart 24 80 $testfile
34
35# Skip all tests if Python scripting is not enabled.
36if { [skip_python_tests] } { continue }
37
38set remote_python_file [gdb_remote_download host \
39 ${srcdir}/${subdir}/${testfile}.py]
40gdb_test_no_output "source ${remote_python_file}" \
41 "source ${testfile}.py"
42
43gdb_test_no_output "tui new-layout test test 1 status 0 cmd 1"
d2d1ea20 44gdb_test_no_output "tui new-layout fail fail 1 status 0 cmd 1"
01b1af32
TT
45
46if {![Term::enter_tui]} {
47 unsupported "TUI not supported"
48}
49
50Term::command "layout test"
51Term::check_contents "test title" \
52 "This Is The Title"
53Term::check_contents "Window display" "Test: 0"
54
e0c23e11
AB
55Term::command "python delete_window_title ()"
56Term::check_contents "error message after trying to delete title" \
57 "TypeError: Cannot delete \"title\" attribute\\."
58Term::check_contents "title is unchanged" \
59 "This Is The Title"
60
01b1af32
TT
61Term::resize 51 51
62# Remember that a resize request actually does two resizes...
63Term::check_contents "Window was updated" "Test: 2"
d2d1ea20
TT
64
65Term::command "layout fail"