Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / subst.exp
1 # Copyright 2006-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 gdb_exit
17 gdb_start
18 gdb_reinitialize_dir $srcdir/$subdir
19
20 # Do a bunch of testing of the set/unset/show substitute-path
21 # commands that do not require the presence of an executable.
22
23 gdb_test_no_output "set confirm off" \
24 "deactivate GDB's confirmation interface"
25
26 gdb_test "show substitute-path" \
27 "List of all source path substitution rules:" \
28 "show substitute-path, no rule entered yet"
29
30 gdb_test "show substitute-path from" \
31 "Source path substitution rule matching `from':" \
32 "show substitute-path from, no rule entered yet"
33
34 gdb_test "show substitute-path too many" \
35 "Too many arguments in command" \
36 "show substitute-path, too many arguments"
37
38 gdb_test "unset substitute-path from" \
39 "No substitution rule defined for `from'" \
40 "unset substitute-path from, no rule entered yet"
41
42 gdb_test_no_output "unset substitute-path" \
43 "unset substitute-path, no rule entered yet"
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 from to" \
50 "Incorrect usage, too many arguments in command" \
51 "unset substitute-path, too many arguments"
52
53 gdb_test "set substitute-path too many arguments" \
54 "Incorrect usage, too many arguments in command" \
55 "set substitute-path, too many arguments"
56
57 gdb_test "set substitute-path missing" \
58 "Incorrect usage, too few arguments in command" \
59 "set substitute-path, too few arguments"
60
61 gdb_test "set substitute-path '' to" \
62 "First argument must be at least one character long" \
63 "set substitute-path, first argument is empty string"
64
65 gdb_test_no_output "set substitute-path from to" \
66 "add from -> to substitution rule"
67
68 gdb_test_no_output "set substitute-path from1 to1/" \
69 "add from1 -> to1 substitution rule"
70
71 gdb_test_no_output "set substitute-path source destination" \
72 "add source -> destination substitution rule"
73
74 gdb_test_no_output "set substitute-path depuis/ vers" \
75 "add depuis -> vers substitution rule"
76
77 gdb_test_no_output "set substitute-path empty ''" \
78 "add substitution rule to empty string"
79
80 gdb_test "show substitute-path" \
81 "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' -> `'." \
82 "show substitute-path after all paths added"
83
84 gdb_test "show substitute-path from" \
85 "Source path substitution rule matching `from':\r\n +`from' -> `to'." \
86 "show substitute-path from, after all paths added"
87
88 gdb_test "show substitute-path depuis" \
89 "Source path substitution rule matching `depuis':\r\n +`depuis' -> `vers'." \
90 "show substitute-path depuis, after all paths added"
91
92 gdb_test "show substitute-path garbage" \
93 "Source path substitution rule matching `garbage':" \
94 "show substitute-path garbage, after all paths added"
95
96 gdb_test_no_output "unset substitute-path from" \
97 "unset substitute-path from"
98
99 gdb_test "show substitute-path from" \
100 "Source path substitution rule matching `from':" \
101 "show substitute-path from, after unsetting it"
102
103 gdb_test "show substitute-path" \
104 "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`depuis' -> `vers'.\r\n +`empty' -> `'." \
105 "show substitute-path after from rule removed"
106
107 gdb_test "unset substitute-path from" \
108 "No substitution rule defined for `from'" \
109 "unset substitute-path from after the rule was removed"
110
111 gdb_test_no_output "unset substitute-path depuis" \
112 "unset substitute-path depuis (middle of list)"
113
114 gdb_test "show substitute-path" \
115 "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'.\r\n\ +`empty' -> `'." \
116 "show substitute-path after depuis rule removed"
117
118 gdb_test_no_output "unset substitute-path empty" \
119 "unset substitute-path empty (end of list)"
120
121 gdb_test "show substitute-path" \
122 "List of all source path substitution rules:\r\n +`from1' -> `to1'.\r\n +`source' -> `destination'." \
123 "show substitute-path after empty rule removed"
124
125 gdb_test_no_output "unset substitute-path" \
126 "remove all remaining substitution rules"
127
128 gdb_test "show substitute-path" \
129 "List of all source path substitution rules:" \
130 "show substitute-path after all remaining rules removed"
131
132
This page took 0.033814 seconds and 5 git commands to generate.