]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.tui/winwidth.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.tui / winwidth.exp
1 # Copyright 2022-2024 Free Software Foundation, Inc.
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 the "winwidth" command.
17
18 tuiterm_env
19
20 standard_testfile tui-layout.c
21
22 if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
23 return -1
24 }
25
26 Term::clean_restart 24 80 $testfile
27 if {![Term::enter_tui]} {
28 unsupported "TUI not supported"
29 return
30 }
31
32 Term::command "tui new-layout h { -horizontal src 1 asm 1 } 1 status 0 cmd 1"
33 Term::command "layout h"
34
35 with_test_prefix "original window sizes" {
36 Term::check_box "source box" 0 0 40 15
37 Term::check_box "asm box" 39 0 41 15
38 Term::command "winwidth src +5"
39 }
40
41 with_test_prefix "after src +5" {
42 Term::check_box "source box" 0 0 45 15
43 Term::check_box "asm box" 44 0 36 15
44 Term::command "winwidth asm -5"
45 }
46
47 with_test_prefix "after asm -5" {
48 Term::dump_screen
49 Term::check_box "source box" 0 0 50 15
50 Term::check_box "asm box" 49 0 31 15
51 Term::command "winwidth asm +8"
52 }
53
54 with_test_prefix "after asm +8" {
55 Term::check_box "source box" 0 0 42 15
56 Term::check_box "asm box" 41 0 39 15
57 Term::command "winwidth src -2"
58 }
59
60 with_test_prefix "after src -2" {
61 Term::check_box "source box" 0 0 40 15
62 Term::check_box "asm box" 39 0 41 15
63 }