]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright (C) 2011-2024 Free Software Foundation, Inc. |
7ff911a3 JK |
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 | ||
822bd149 | 16 | standard_testfile .c |
7ff911a3 JK |
17 | set inputrc ${srcdir}/${subdir}/${testfile}.inputrc |
18 | ||
19 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } { | |
5b362f04 | 20 | untested "failed to compile" |
7ff911a3 JK |
21 | return -1 |
22 | } | |
23 | ||
4ebfd53d TT |
24 | setenv TERM dumb |
25 | ||
7ff911a3 JK |
26 | # INPUTRC gets reset for the next testfile. |
27 | setenv INPUTRC $inputrc | |
822bd149 | 28 | clean_restart ${binfile} |
7ff911a3 | 29 | |
0d4d0e77 YQ |
30 | if { ![readline_is_used] } { |
31 | unsupported "completion doesn't work when readline isn't used." | |
32 | return -1 | |
33 | } | |
34 | ||
7ff911a3 JK |
35 | gdb_test_no_output "set width 50" |
36 | gdb_test_no_output "set height 3" | |
37 | ||
38 | set cmd "p symbol_0" | |
39 | send_gdb "$cmd\t" | |
40 | set test "bell for more message" | |
41 | gdb_test_multiple "" $test { | |
42 | -re "$cmd\007$" { | |
43 | pass $test | |
44 | } | |
45 | } | |
46 | ||
47 | send_gdb "\t" | |
48 | set test "more message for 01 and 02" | |
49 | gdb_test_multiple "" $test { | |
50 | -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" { | |
51 | pass $test | |
52 | } | |
53 | -re "$gdb_prompt " { | |
54 | fail $test | |
55 | } | |
56 | } | |
57 | ||
58 | # There get some VT100 characters printed. | |
59 | ||
60 | send_gdb "\r" | |
61 | set test "more message for 03" | |
62 | gdb_test_multiple "" $test { | |
63 | -re "\rsymbol_03_length_40_____________________\r\n--More--$" { | |
64 | pass $test | |
65 | } | |
66 | } | |
67 | ||
68 | # "$gdb_prompt $" will not match as $cmd gets output: $gdb_prompt p symbol_0 | |
69 | # And "$gdb_prompt p symbol_0" cannot be matched as the default "$gdb_prompt $" | |
70 | # string from gdb_test_multiple could match earlier. | |
71 | ||
72 | send_gdb "\r" | |
73 | set test "more finish for 04" | |
74 | gdb_test_multiple "" $test { | |
75 | -re "\rsymbol_04_length_40_____________________\r\n$gdb_prompt " { | |
76 | pass $test | |
77 | } | |
78 | } | |
79 | ||
80 | gdb_test "foo" {No symbol "symbol_0foo" in current context\.} "abort more message" | |
81 | ||
82 | set cmd "p symbol_" | |
83 | send_gdb "$cmd\t" | |
84 | set test "bell for ask message" | |
85 | gdb_test_multiple "" $test { | |
86 | -re "$cmd\007$" { | |
87 | pass $test | |
88 | } | |
89 | } | |
90 | ||
91 | send_gdb "\t" | |
92 | set test "ask message" | |
93 | gdb_test_multiple "" $test { | |
94 | -re "^\r\nDisplay all 5 possibilities\\? \\(y or n\\)$" { | |
95 | pass $test | |
96 | } | |
97 | -re "$gdb_prompt " { | |
98 | fail $test | |
99 | return 0 | |
100 | } | |
101 | } | |
102 | ||
103 | send_gdb "y" | |
104 | set test "ask message for 01 and 02" | |
105 | gdb_test_multiple "" $test { | |
106 | -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" { | |
107 | pass $test | |
108 | } | |
109 | } | |
110 | ||
111 | # There get some VT100 characters printed. | |
112 | # See the "$gdb_prompt " match like in "more finish for 04". | |
113 | ||
114 | send_gdb "n" | |
115 | set test "ask message no" | |
116 | gdb_test_multiple "" $test { | |
117 | -re "\r$gdb_prompt " { | |
118 | pass $test | |
119 | } | |
120 | } | |
121 | ||
122 | gdb_test "foo" {No symbol "symbol_foo" in current context\.} "abort ask message" |