* gdb.gdb/python-selftest.exp: New file.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.gdb / xfullpath.exp
1 # Copyright 2002-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 file was written by Joel Brobecker. (brobecker@gnat.com), derived
17 # from selftest.exp, written by Rob Savoye.
18
19 load_lib selftest-support.exp
20
21 # are we on a target board
22 if { [is_remote target] || ![isnative] } then {
23 return
24 }
25
26 proc test_with_self {} {
27 # A file which contains a directory prefix
28 gdb_test "print gdb_realpath (\"./xfullpath.exp\")" \
29 ".\[0-9\]+ =.*\".*/xfullpath.exp\"" \
30 "A filename with ./ as the directory prefix"
31
32 # A file which contains a directory prefix
33 gdb_test "print gdb_realpath (\"../../defs.h\")" \
34 ".\[0-9\]+ =.*\".*/defs.h\"" \
35 "A filename with ../ in the directory prefix"
36
37 # A one-character filename
38 gdb_test "print gdb_realpath (\"./a\")" \
39 ".\[0-9\]+ =.*\".*/a\"" \
40 "A one-char filename in the current directory"
41
42 # A file in the root directory
43 gdb_test "print gdb_realpath (\"/root_file_which_should_exist\")" \
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
48 gdb_test "print gdb_realpath (\"xfullpath.exp\")" \
49 ".\[0-9\]+ =.*\"xfullpath.exp\"" \
50 "A filename without any directory prefix"
51
52 # A one-char filename without any directory prefix
53 gdb_test "print gdb_realpath (\"a\")" \
54 ".\[0-9\]+ =.*\"a\"" \
55 "A one-char filename without any directory prefix"
56
57 # An empty filename
58 gdb_test "print gdb_realpath (\"\")" \
59 ".\[0-9\]+ =.*\"\"" \
60 "An empty filename"
61
62 return 0
63 }
64
65 do_self_tests captured_main test_with_self
This page took 0.040095 seconds and 4 git commands to generate.