]>
Commit | Line | Data |
---|---|---|
213516ef | 1 | # Copyright 2022-2023 Free Software Foundation, Inc. |
f62843d7 AB |
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 'info win'. | |
17 | ||
18 | tuiterm_env | |
19 | ||
20 | standard_testfile | |
21 | ||
22 | Term::clean_restart 24 80 | |
23 | ||
24 | if {![Term::enter_tui]} { | |
25 | unsupported "TUI not supported" | |
26 | return | |
27 | } | |
28 | ||
29 | Term::command "layout src" | |
30 | Term::command "info win" | |
31 | Term::check_region_contents "info win, layout src" \ | |
32 | 0 16 80 8 [multi_line "info win\\s+" \ | |
33 | "Name\\s+Lines\\s+Columns\\s+Focus\\s+" \ | |
34 | "src\\s+15\\s+80\\s+\\(has focus\\)\\s+" \ | |
35 | "status\\s+1\\s+80\\s+" \ | |
36 | "cmd\\s+8\\s+80\\s+"] | |
37 | ||
38 | Term::command "tui new-layout h { -horizontal src 1 asm 1 } 1 status 0 cmd 1" | |
39 | Term::command "layout h" | |
40 | Term::command "winheight cmd + 3" | |
41 | ||
42 | # As the tuiterm.exp library just waits for the prompt and command to | |
43 | # be echo'ed bcak to the screen, multiple 'info win' calls like this | |
44 | # have a problem. Dejagnu will send the command to gdb, but will then | |
45 | # immediately see the '(gdb) info win' output from the first use | |
46 | # above. This means we end up rushing ahead, and some tests might | |
47 | # fail. | |
48 | # | |
49 | # To work around this, I'm sending a unique command 'p 1' here, that | |
50 | # only happens after the second 'info win' call. When the 'p 1' | |
51 | # completes, I know the second 'info win' has also completed. | |
52 | Term::command "info win" | |
53 | Term::command "p 1" | |
54 | ||
55 | Term::check_region_contents "info win, layout h" \ | |
56 | 0 13 80 11 [multi_line "info win\\s+" \ | |
57 | "Name\\s+Lines\\s+Columns\\s+Focus\\s+" \ | |
58 | "src\\s+12\\s+40\\s+\\(has focus\\)\\s+" \ | |
59 | "asm\\s+12\\s+41\\s+" \ | |
60 | "status\\s+1\\s+80\\s+" \ | |
61 | "cmd\\s+11\\s+80\\s+"] |