1 # Copyright 2021 Free Software Foundation, Inc.
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.
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.
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/>.
16 # Check scrolling in the command window. This test only covers the
17 # case where scrolling in the command window is caused by issuing many
18 # non-inferior related commands, as once the inferior is given control
19 # the terminal settings are modified and our tuiterm library really
24 standard_testfile tui-layout.c
26 if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
30 Term::clean_restart 24 80 $testfile
31 if {![Term::enter_tui]} {
32 unsupported "TUI not supported"
36 for {set i 0} {$i < 10} {incr i 1} {
40 # Now check that the contents of the command window are as expected.
41 Term::check_region_contents "check cmd window" 0 16 80 8 \
52 # Now create a new layout where the CMD window is at the top of the
53 # screen. Sitch to this layout and ensure that scrolling still works
55 Term::command "tui new-layout flip cmd 1 src 1"
56 Term::command "layout flip"
58 for {set i 10} {$i < 20} {incr i 1} {
62 # Now check that the contents of the command window are as expected.
63 Term::check_region_contents "check cmd window in flip layout" 0 0 80 8 \
66 "\\(gdb\\) p 17\\s+" \
68 "\\(gdb\\) p 18\\s+" \
70 "\\(gdb\\) p 19\\s+" \