Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / subst.exp
CommitLineData
28e7fd62 1# Copyright 2006-2013 Free Software Foundation, Inc.
dd920c33
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
dd920c33
JB
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
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
dd920c33 15
dd920c33
JB
16gdb_exit
17gdb_start
18gdb_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
27d3a1a2 23gdb_test_no_output "set confirm off" \
dd920c33
JB
24 "deactivate GDB's confirmation interface"
25
26gdb_test "show substitute-path" \
27 "List of all source path substitution rules:" \
28 "show substitute-path, no rule entered yet"
29
30gdb_test "show substitute-path from" \
31 "Source path substitution rule matching `from':" \
32 "show substitute-path from, no rule entered yet"
33
34gdb_test "show substitute-path too many" \
35 "Too many arguments in command" \
36 "show substitute-path, too many arguments"
37
38gdb_test "unset substitute-path from" \
39 "No substitution rule defined for `from'" \
40 "unset substitute-path from, no rule entered yet"
41
27d3a1a2 42gdb_test_no_output "unset substitute-path" \
dd920c33
JB
43 "unset substitute-path, no rule entered yet"
44
45gdb_test "unset substitute-path from" \
46 "No substitution rule defined for `from'" \
47 "unset substitute-path from, no rule entered yet"
48
49gdb_test "unset substitute-path from to" \
50 "Incorrect usage, too many arguments in command" \
51 "unset substitute-path, too many arguments"
52
53gdb_test "set substitute-path too many arguments" \
54 "Incorrect usage, too many arguments in command" \
55 "set substitute-path, too many arguments"
56
57gdb_test "set substitute-path missing" \
58 "Incorrect usage, too few arguments in command" \
59 "set substitute-path, too few arguments"
60
61gdb_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
27d3a1a2 65gdb_test_no_output "set substitute-path from to" \
dd920c33
JB
66 "add from -> to substitution rule"
67
27d3a1a2 68gdb_test_no_output "set substitute-path from1 to1/" \
dd920c33
JB
69 "add from1 -> to1 substitution rule"
70
27d3a1a2 71gdb_test_no_output "set substitute-path source destination" \
dd920c33
JB
72 "add source -> destination substitution rule"
73
27d3a1a2 74gdb_test_no_output "set substitute-path depuis/ vers" \
dd920c33
JB
75 "add depuis -> vers substitution rule"
76
27d3a1a2 77gdb_test_no_output "set substitute-path empty ''" \
dd920c33
JB
78 "add substitution rule to empty string"
79
80gdb_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
84gdb_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
88gdb_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
92gdb_test "show substitute-path garbage" \
93 "Source path substitution rule matching `garbage':" \
94 "show substitute-path garbage, after all paths added"
95
27d3a1a2 96gdb_test_no_output "unset substitute-path from" \
dd920c33
JB
97 "unset substitute-path from"
98
99gdb_test "show substitute-path from" \
100 "Source path substitution rule matching `from':" \
f629457d 101 "show substitute-path from, after unsetting it"
dd920c33
JB
102
103gdb_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
107gdb_test "unset substitute-path from" \
108 "No substitution rule defined for `from'" \
109 "unset substitute-path from after the rule was removed"
110
27d3a1a2 111gdb_test_no_output "unset substitute-path depuis" \
dd920c33
JB
112 "unset substitute-path depuis (middle of list)"
113
114gdb_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
27d3a1a2 118gdb_test_no_output "unset substitute-path empty" \
dd920c33
JB
119 "unset substitute-path empty (end of list)"
120
121gdb_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
27d3a1a2 125gdb_test_no_output "unset substitute-path" \
dd920c33
JB
126 "remove all remaining substitution rules"
127
128gdb_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.66206 seconds and 4 git commands to generate.