* gdb.base/help.exp: Remove testing of individual command help text,
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / help.exp
1 # Copyright 1988, 1990-1992, 1994-2000, 2002-2003, 2005-2012 Free
2 # Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 # This file was written by Rob Savoye. (rob@cygnus.com)
18
19 # Test basic help functionality.
20 # This is not intended to test the help text of every command,
21 # or even more than a few commands - too much of a maintenance burden.
22
23 gdb_start
24
25 # disable pagination
26 gdb_test_no_output "set height 0" "disable pagination"
27
28 # Test all the help classes.
29 test_class_help "aliases" {"Aliases of other commands\.\[\r\n\]+"}
30 test_class_help "breakpoints" {
31 "Making program stop at certain points\.\[\r\n\]+"
32 }
33 test_class_help "data" {"Examining data\.\[\r\n\]+"}
34 test_class_help "files" {"Specifying and examining files\.\[\r\n\]+"}
35 test_class_help "internals" {
36 "Maintenance commands\.\[\r\n\]+"
37 "Some gdb commands are provided just for use by gdb maintainers\.\[\r\n\]+"
38 "These commands are subject to frequent change, and may not be as\[\r\n\]+"
39 "well documented as user commands\.\[\r\n\]+"
40 }
41 test_class_help "obscure" {"Obscure features\.\[\r\n\]+"}
42 test_class_help "running" {"Running the program\.\[\r\n\]+"}
43 test_class_help "stack" {
44 "Examining the stack\..*\[\r\n\]+"
45 "When the program being debugged stops, gdb selects the innermost frame\.\[\r\n\]+"
46 "The commands below can be used to select other frames by number or address\.\[\r\n\]+"
47 }
48 test_class_help "status" {
49 "Status inquiries\.\[\r\n\]+"
50 }
51 test_class_help "support" {"Support facilities\.\[\r\n\]+"}
52 test_class_help "tracepoints" {
53 "Tracing of program execution without stopping the program\.\[\r\n\]+"
54 }
55 test_class_help "user-defined" {
56 "User-defined commands\.\[\r\n\]+"
57 "The commands in this class are those defined by the user\.\[\r\n\]+"
58 "Use the \"define\" command to define a command\.\[\r\n\]+"
59 }
60
61 # Test help of an abbreviated command. "break" is picked at random.
62 set help_breakpoint_text "Set breakpoint at specified line or function\..*"
63 # test help breakpoint "b" abbreviation
64 gdb_test "help b" $help_breakpoint_text "help breakpoint \"b\" abbreviation"
65 # test help breakpoint "br" abbreviation
66 gdb_test "help br" $help_breakpoint_text "help breakpoint \"br\" abbreviation"
67 # test help breakpoint "bre" abbreviation
68 gdb_test "help bre" $help_breakpoint_text "help breakpoint \"bre\" abbreviation"
69 # test help breakpoint "brea" abbreviation
70 gdb_test "help brea" $help_breakpoint_text "help breakpoint \"brea\" abbreviation"
71 # test help breakpoint "break" abbreviation
72 gdb_test "help break" $help_breakpoint_text "help breakpoint \"break\" abbreviation"
73
74 # Test help of an aliased command. "bt" is picked at random.
75 set help_backtrace_text "Print backtrace of all stack frames, or innermost COUNT frames\..*"
76 # test help backtrace "bt" abbreviation
77 gdb_test "help bt" $help_backtrace_text "help backtrace \"bt\" abbreviation"
78 # test help backtrace
79 gdb_test "help backtrace" $help_backtrace_text "help backtrace"
80
81 # test help commands
82 gdb_test "help commands" "Set commands to be executed when a breakpoint is hit\.\[\r\n\]+Give breakpoint number as argument after \"commands\"\.\[\r\n\]+With no argument, the targeted breakpoint is the last one set\.\[\r\n\]+The commands themselves follow starting on the next line\.\[\r\n\]+Type a line containing \"end\" to indicate the end of them\.\[\r\n\]+Give \"silent\" as the first line to make the breakpoint silent;\[\r\n\]+then no output is printed when it is hit, except what the commands print\." "help commands"
83
84 # Test a prefix command. "delete" is picked at random.
85 # test help delete "d" abbreviation
86 set expected_help_delete {
87 "Delete some breakpoints or auto-display expressions\.\[\r\n\]+"
88 "Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+"
89 "To delete all breakpoints, give no argument\.\[\r\n\]+"
90 "Also a prefix command for deletion of other GDB objects\.\[\r\n\]+"
91 "The \"unset\" command is also an alias for \"delete\"\.\[\r\n\]+"
92 }
93 test_prefix_command_help {"d" "delete"} $expected_help_delete "help delete \"d\" abbreviation"
94 # test help delete
95 test_prefix_command_help "delete" $expected_help_delete
96
97 # Make sure help for help itself is present.
98 # test help help "h" abbreviation
99 gdb_test "help h" "Print list of commands\." "help help \"h\" abbreviation"
100 # test help help
101 gdb_test "help help" "Print list of commands\." "help help"
102
103 # The startup banner refers to "show copying" and "show warranty",
104 # might as well test for them.
105 # test help info copying
106 gdb_test "help show copying" "Conditions for redistributing copies of GDB\." \
107 "help show copying"
108 # test help info warranty
109 gdb_test "help show warranty" "Various kinds of warranty you do not have\." \
110 "help show warranty"
111
112 # Test a few other random "help show" commands.
113 # test help show commands
114 gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\." "help show commands"
115 # test help show confirm
116 gdb_test "help show confirm" "Show whether to confirm potentially dangerous operations\." "help show confirm"
117
118 # test help info bogus-gdb-command
119 gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\"\. Try \"help info\"\." "help info bogus-gdb-command"
120 # test help gotcha
121 gdb_test "help gotcha" "Undefined command: \"gotcha\"\. Try \"help\"\." "help gotcha"
122
123 # test apropos regex
124 gdb_test "apropos \\\(print\[\^ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle signals"
125 # test apropos >1 word string
126 gdb_test "apropos handle signal" "handle -- Specify how to handle signals"
127 # test apropos apropos
128 gdb_test "apropos apropos" "apropos -- Search for commands matching a REGEXP"
This page took 0.0343 seconds and 5 git commands to generate.