Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.tui / pr30056.exp
blob11e198d7889470e004ef6f7fed9798009b549f73
1 # Copyright 2023-2024 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 # Regression test for PR30056.
18 # This PR is fixed in the in-repo copy of readline.  System readline may or
19 # may not be fixed, so skip this test-case.
20 require !with_system_readline
21 require {have_host_locale C.UTF-8}
23 tuiterm_env
25 save_vars { env(LC_ALL) } {
26     setenv LC_ALL C.UTF-8
28     # Start terminal.
29     Term::clean_restart 24 80
31     # Start TUI.
32     if {![Term::enter_tui]} {
33         unsupported "TUI not supported"
34         return
35     }
37     # Send "^R", starting reverse-i-search.
38     send_gdb "\022"
39     Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 \
40         [string_to_regexp "(reverse-i-search)`': "]
42     # Send "xyz".
43     send_gdb "xyz"
44     Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 \
45         [string_to_regexp "(failed reverse-i-search)`xyz': "]
47     # Send arrow-right.
48     send_gdb "\033\[C"
50     # We need to the arrow-right to be processed by readline, before we
51     # send the following ^C.  Waiting 1 ms seems to do that.
52     after 1
54     # Send ^C.
55     send_gdb "\003"
56     gdb_assert { [Term::wait_for "Quit"] } "Control-C"
58     # Uncomment this to simulate that PR cli/30498 is fixed.
59     #send_gdb "\007"
61     set test "Control-C aborts isearch"
63     # Send "xyz", again.
64     send_gdb "xyz"
65     # Wait for xyx to appear.
66     Term::wait_for_region_contents 0 $Term::_cur_row $Term::_cols 1 "xyz"
68     if { [Term::check_region_contents_p 0 $Term::_cur_row $Term::_cols 1 \
69               "^$gdb_prompt xyz"] } {
70         pass $test
72         # Send ^C to clear the command line.
73         send_gdb "\003"
74     } else {
75         # Sending ^C currently doesn't abort the i-search. PR cli/30498 is
76         # open about this.
77         kfail cli/30498 $test
79         # At this point we don't have a reponsive prompt.  Send ^G to abort
80         # the i-search.
81         send_gdb "\007"
82     }
84     # We need a reponsive prompt here, to deal with the "monitor exit"
85     # that native-extended-gdbserver will send.  Check that we have a
86     # responsive prompt.
87     Term::command "echo \\n"