warn if "source" fails to open the file when from_tty == 0
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / filesym.exp
CommitLineData
bba5b667
KS
1# Copyright 2013 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
52c935b6 29set tst "complete on \"filesy\""
bba5b667 30send_gdb "break filesy\t"
52c935b6
KS
31gdb_test_multiple "" $tst {
32 -re "break filesy\\\x07m\$" {
33 pass $tst
bba5b667
KS
34
35 # Now ask for the completion list
52c935b6 36 set tst "completion list for \"filesym\""
bba5b667 37 send_gdb "\t\t"
52c935b6
KS
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"
bba5b667
KS
46 }
47 }
48 }
bba5b667 49}
52c935b6
KS
50
51unset -nocomplain tst
This page took 0.08367 seconds and 4 git commands to generate.