filesym.exp revision 1.1
1# Copyright 2013-2014 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# 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
19standard_testfile
20
21if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
22    return -1
23}
24
25# Test completion list for "filesy".  We expect the immediate result to
26# complete to "filesym"; completing again, we expect the symbol name and the
27# filename (in that order).
28
29set tst "complete on \"filesy\""
30send_gdb "break filesy\t"
31gdb_test_multiple "" $tst {
32    -re "break filesy\\\x07m\$" {
33	pass $tst
34
35	# Now ask for the completion list
36	set tst "completion list for \"filesym\""
37	send_gdb "\t\t"
38	gdb_test_multiple "" $tst {
39	    -re "\\\x07\r\nfilesym\[ \t\]+filesym.c\[ \t\]+\r\n$gdb_prompt " {
40		pass $tst
41
42		# Flush the rest of the output by creating the breakpoint.
43		# This ensures this file passes testsuite/12649.
44		send_gdb "\n"
45		gdb_test "" "Breakpoint 1.*" "set breakpoint at filesym"
46	    }
47	}
48    }
49}
50
51unset -nocomplain tst
52