Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | # Copyright 2019-2020 Free Software Foundation, Inc. |
2b1d00c2 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 TUI resizing with empty windows. | |
17 | ||
8c74a764 | 18 | tuiterm_env |
2b1d00c2 TT |
19 | |
20 | standard_testfile | |
21 | ||
22 | Term::clean_restart 24 80 | |
23 | ||
24 | if {![Term::enter_tui]} { | |
25 | unsupported "TUI not supported" | |
581bea2c | 26 | return |
2b1d00c2 TT |
27 | } |
28 | ||
29 | # Each entry describes a layout. It has these items: | |
30 | # 1. Layout name | |
31 | # 2. Test name | |
32 | # 3. List of boxes in 80x24 mode | |
33 | # 4. List of boxes in 90x40 mode | |
34 | # 5. List of test name and text for the empty window | |
35 | set layouts { | |
3d979945 | 36 | {src src {{0 0 80 15}} {{0 0 90 26}} |
2b1d00c2 | 37 | {{"no source" "No Source Available"}}} |
3d979945 | 38 | {regs src-regs {{0 0 80 7} {0 6 80 9}} {{0 0 90 13} {0 12 90 13}} |
2b1d00c2 TT |
39 | { |
40 | {"no source" "No Source Available"} | |
41 | {"no regs" "Register Values Unavailable"} | |
42 | }} | |
3d979945 | 43 | {asm asm {{0 0 80 13}} {{0 0 90 26}} |
45e42163 TT |
44 | { |
45 | {"no asm" "No Assembly Available"} | |
46 | }} | |
3d979945 | 47 | {regs asm-regs {{0 0 80 7} {0 6 80 9}} {{0 0 90 13} {0 12 90 13}} |
2b1d00c2 TT |
48 | { |
49 | {"no asm" "No Assembly Available"} | |
50 | {"no regs" "Register Values Unavailable"} | |
51 | }} | |
3d979945 | 52 | {split split {{0 0 80 6} {0 5 80 8}} {{0 0 90 13} {0 12 90 13}} |
2b1d00c2 TT |
53 | { |
54 | {"no source" "No Source Available"} | |
55 | {"no asm" "No Assembly Available"} | |
56 | }} | |
3d979945 | 57 | {regs split-regs {{0 0 80 6} {0 5 80 8}} {{0 0 90 13} {0 12 90 13}} |
2b1d00c2 TT |
58 | { |
59 | {"no asm" "No Assembly Available"} | |
60 | {"no regs" "Register Values Unavailable"} | |
61 | }} | |
62 | } | |
63 | ||
64 | # Helper function to verify a list of boxes. | |
65 | proc check_boxes {boxes} { | |
66 | set boxno 1 | |
67 | foreach box $boxes { | |
2b1d00c2 TT |
68 | eval Term::check_box [list "box $boxno"] $box |
69 | incr boxno | |
70 | } | |
71 | } | |
72 | ||
73 | # Helper function to verify text. | |
74 | proc check_text {text_list} { | |
75 | set text [Term::get_all_lines] | |
76 | foreach item $text_list { | |
77 | lassign $item testname check | |
45e42163 TT |
78 | if {![gdb_assert {[regexp -- $check $text]} $testname]} { |
79 | Term::dump_screen | |
80 | } | |
2b1d00c2 TT |
81 | } |
82 | } | |
83 | ||
84 | foreach layout $layouts { | |
85 | lassign $layout name testname small_boxes large_boxes text_list | |
86 | ||
87 | with_test_prefix $testname { | |
88 | Term::command "layout $name" | |
89 | with_test_prefix 80x24 { | |
90 | check_boxes $small_boxes | |
91 | check_text $text_list | |
92 | } | |
93 | ||
3df505f6 TT |
94 | Term::resize 40 90 |
95 | with_test_prefix 90x40 { | |
96 | check_boxes $large_boxes | |
97 | check_text $text_list | |
98 | } | |
99 | Term::resize 24 80 | |
2b1d00c2 TT |
100 | } |
101 | } |