Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | # Copyright 2013-2020 Free Software Foundation, Inc. |
bba5b667 KS |
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 | # This series of completion tests checks the completion output | |
17 | # on a name which is potentially both a symbol name and a file name. | |
18 | ||
19 | standard_testfile | |
20 | ||
5b362f04 | 21 | if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { |
bba5b667 KS |
22 | return -1 |
23 | } | |
24 | ||
0d4d0e77 YQ |
25 | if { ![readline_is_used] } { |
26 | unsupported "completion doesn't work when readline isn't used." | |
27 | return -1 | |
28 | } | |
29 | ||
30 | ||
bba5b667 KS |
31 | # Test completion list for "filesy". We expect the immediate result to |
32 | # complete to "filesym"; completing again, we expect the symbol name and the | |
33 | # filename (in that order). | |
34 | ||
52c935b6 | 35 | set tst "complete on \"filesy\"" |
bba5b667 | 36 | send_gdb "break filesy\t" |
52c935b6 KS |
37 | gdb_test_multiple "" $tst { |
38 | -re "break filesy\\\x07m\$" { | |
39 | pass $tst | |
bba5b667 KS |
40 | |
41 | # Now ask for the completion list | |
52c935b6 | 42 | set tst "completion list for \"filesym\"" |
bba5b667 | 43 | send_gdb "\t\t" |
52c935b6 KS |
44 | gdb_test_multiple "" $tst { |
45 | -re "\\\x07\r\nfilesym\[ \t\]+filesym.c\[ \t\]+\r\n$gdb_prompt " { | |
46 | pass $tst | |
47 | ||
48 | # Flush the rest of the output by creating the breakpoint. | |
49 | # This ensures this file passes testsuite/12649. | |
50 | send_gdb "\n" | |
51 | gdb_test "" "Breakpoint 1.*" "set breakpoint at filesym" | |
bba5b667 KS |
52 | } |
53 | } | |
54 | } | |
bba5b667 | 55 | } |
52c935b6 KS |
56 | |
57 | unset -nocomplain tst |