]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/subst.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / subst.exp
1 # Copyright 2006, 2007 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 2 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, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 # MA 02110-1301, USA
17
18 if $tracelevel {
19 strace $tracelevel
20 }
21
22 gdb_exit
23 gdb_start
24 gdb_reinitialize_dir $srcdir/$subdir
25
26 # Do a bunch of testing of the set/unset/show substitute-path
27 # commands that do not require the presence of an executable.
28
29 gdb_test "set confirm off" \
30 "" \
31 "deactivate GDB's confirmation interface"
32
33 gdb_test "show substitute-path" \
34 "List of all source path substitution rules:" \
35 "show substitute-path, no rule entered yet"
36
37 gdb_test "show substitute-path from" \
38 "Source path substitution rule matching `from':" \
39 "show substitute-path from, no rule entered yet"
40
41 gdb_test "show substitute-path too many" \
42 "Too many arguments in command" \
43 "show substitute-path, too many arguments"
44
45 gdb_test "unset substitute-path from" \
46 "No substitution rule defined for `from'" \
47 "unset substitute-path from, no rule entered yet"
48
49 gdb_test "unset substitute-path" \
50 "" \
51 "unset substitute-path, no rule entered yet"
52
53 gdb_test "unset substitute-path from" \
54 "No substitution rule defined for `from'" \
55 "unset substitute-path from, no rule entered yet"
56
57 gdb_test "unset substitute-path from to" \
58 "Incorrect usage, too many arguments in command" \
59 "unset substitute-path, too many arguments"
60
61 gdb_test "set substitute-path too many arguments" \
62 "Incorrect usage, too many arguments in command" \
63 "set substitute-path, too many arguments"
64
65 gdb_test "set substitute-path missing" \
66 "Incorrect usage, too few arguments in command" \
67 "set substitute-path, too few arguments"
68
69 gdb_test "set substitute-path '' to" \
70 "First argument must be at least one character long" \
71 "set substitute-path, first argument is empty string"
72
73 gdb_test "set substitute-path from to" \
74 "" \
75 "add from -> to substitution rule"
76
77 gdb_test "set substitute-path from1 to1/" \
78 "" \
79 "add from1 -> to1 substitution rule"
80
81 gdb_test "set substitute-path source destination" \
82 "" \
83 "add source -> destination substitution rule"
84
85 gdb_test "set substitute-path depuis/ vers" \
86 "" \
87 "add depuis -> vers substitution rule"
88
89 gdb_test "set substitute-path empty ''" \
90 "" \
91 "add substitution rule to empty string"
92
93 gdb_test "show substitute-path" \
94 "List of all source path substitution rules:\r\n +`from' -> `to'.\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
95 "show substitute-path after all paths added"
96
97 gdb_test "show substitute-path from" \
98 "Source path substitution rule matching `from':\r\n +`from' -> `to'." \
99 "show substitute-path from, after all paths added"
100
101 gdb_test "show substitute-path depuis" \
102 "Source path substitution rule matching `depuis':\r\n +`depuis' -> `vers'." \
103 "show substitute-path depuis, after all paths added"
104
105 gdb_test "show substitute-path garbage" \
106 "Source path substitution rule matching `garbage':" \
107 "show substitute-path garbage, after all paths added"
108
109 gdb_test "unset substitute-path from" \
110 "" \
111 "unset substitute-path from"
112
113 gdb_test "show substitute-path from" \
114 "Source path substitution rule matching `from':" \
115 ""
116
117 gdb_test "show substitute-path" \
118 "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
119 "show substitute-path after from rule removed"
120
121 gdb_test "unset substitute-path from" \
122 "No substitution rule defined for `from'" \
123 "unset substitute-path from after the rule was removed"
124
125 gdb_test "unset substitute-path depuis" \
126 "" \
127 "unset substitute-path depuis (middle of list)"
128
129 gdb_test "show substitute-path" \
130 "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`empty' -> `'." \
131 "show substitute-path after depuis rule removed"
132
133 gdb_test "unset substitute-path empty" \
134 "" \
135 "unset substitute-path empty (end of list)"
136
137 gdb_test "show substitute-path" \
138 "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'." \
139 "show substitute-path after empty rule removed"
140
141 gdb_test "unset substitute-path" \
142 "" \
143 "remove all remaining substitution rules"
144
145 gdb_test "show substitute-path" \
146 "List of all source path substitution rules:" \
147 "show substitute-path after all remaining rules removed"
148
149