* gdb.gdb/python-selftest.exp: New file.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.gdb / xfullpath.exp
CommitLineData
8acc9f48 1# Copyright 2002-2013 Free Software Foundation, Inc.
989d314b
JB
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
989d314b 6# (at your option) any later version.
e22f8b7c 7#
989d314b
JB
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.
e22f8b7c 12#
989d314b 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
989d314b 15
989d314b
JB
16# This file was written by Joel Brobecker. (brobecker@gnat.com), derived
17# from selftest.exp, written by Rob Savoye.
18
c95aea6b 19load_lib selftest-support.exp
989d314b
JB
20
21# are we on a target board
c1d88655 22if { [is_remote target] || ![isnative] } then {
989d314b
JB
23 return
24}
25
c95aea6b 26proc test_with_self {} {
989d314b 27 # A file which contains a directory prefix
f5b95b50 28 gdb_test "print gdb_realpath (\"./xfullpath.exp\")" \
989d314b
JB
29 ".\[0-9\]+ =.*\".*/xfullpath.exp\"" \
30 "A filename with ./ as the directory prefix"
31
32 # A file which contains a directory prefix
f5b95b50 33 gdb_test "print gdb_realpath (\"../../defs.h\")" \
989d314b
JB
34 ".\[0-9\]+ =.*\".*/defs.h\"" \
35 "A filename with ../ in the directory prefix"
36
37 # A one-character filename
f5b95b50 38 gdb_test "print gdb_realpath (\"./a\")" \
989d314b
JB
39 ".\[0-9\]+ =.*\".*/a\"" \
40 "A one-char filename in the current directory"
41
42 # A file in the root directory
f5b95b50 43 gdb_test "print gdb_realpath (\"/root_file_which_should_exist\")" \
989d314b
JB
44 ".\[0-9\]+ =.*\"/root_file_which_should_exist\"" \
45 "A filename in the root directory"
46
47 # A file which does not have a directory prefix
f5b95b50 48 gdb_test "print gdb_realpath (\"xfullpath.exp\")" \
989d314b
JB
49 ".\[0-9\]+ =.*\"xfullpath.exp\"" \
50 "A filename without any directory prefix"
51
52 # A one-char filename without any directory prefix
f5b95b50 53 gdb_test "print gdb_realpath (\"a\")" \
989d314b
JB
54 ".\[0-9\]+ =.*\"a\"" \
55 "A one-char filename without any directory prefix"
56
57 # An empty filename
f5b95b50 58 gdb_test "print gdb_realpath (\"\")" \
989d314b
JB
59 ".\[0-9\]+ =.*\"\"" \
60 "An empty filename"
61
62 return 0
63}
64
c95aea6b 65do_self_tests captured_main test_with_self
This page took 1.162337 seconds and 4 git commands to generate.