]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.tui/single-key.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.tui / single-key.exp
1 # Copyright 2023-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 tuiterm_env
17
18 Term::clean_restart 24 80
19 if {![Term::enter_tui]} {
20 unsupported "TUI not supported"
21 return
22 }
23
24 set status_win { 0 15 80 1 }
25 set command_win { 0 16 80 8 }
26
27 # Check that the status window doesn't show Singlekey.
28 set re [string_to_regexp "No process (src) In:"]
29 Term::check_region_contents "status window: initial" {*}$status_win $re
30
31 # Enter single-key mode. Check that the status window does show Singlekey.
32 send_gdb "\030s"
33 set re [string_to_regexp "No process (SingleKey) (src) In:"]
34 gdb_assert { [Term::wait_for_region_contents {*}$status_win $re] } \
35 "status window: single-key mode"
36
37 # Send "down command".
38 send_gdb "d"
39 gdb_assert { [Term::wait_for_region_contents {*}$command_win "No stack\\."] } \
40 "down using single-key d"
41
42 # Quit single-key mode.
43 send_gdb "q"
44 gdb_assert { [Term::wait_for ""] } "quit using single-key q"
45
46 # Enter single-key mode, again.
47 send_gdb "\030s"
48
49 # Send string that doesn't start with a single-key.
50 send_gdb "abc"
51 set re "$gdb_prompt abc"
52 gdb_assert { [Term::wait_for_region_contents {*}$command_win $re] } \
53 "temporary command prompt"
54
55 # Enter undefined command abc, and back to single-key mode.
56 send_gdb "\n"
57
58 # Exit single-key mode, now using C-x s.
59 send_gdb "\030s"
60 gdb_assert { [Term::wait_for ""] } "quit using C-x s"