diff options
author | Tom de Vries <tdevries@suse.de> | 2019-11-02 06:55:10 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2019-11-02 06:55:10 +0100 |
commit | 11af934b5cdba71d14f8ea7905b484c8a6ba0561 (patch) | |
tree | 8f3f9303975c94a58bd00685f6025cf12e6b8eba /gdb/testsuite/gdb.base/info-macros.exp | |
parent | e96ec2bab75a943e1666497b1389e297775af5a8 (diff) | |
download | gdb-11af934b5cdba71d14f8ea7905b484c8a6ba0561.zip gdb-11af934b5cdba71d14f8ea7905b484c8a6ba0561.tar.gz gdb-11af934b5cdba71d14f8ea7905b484c8a6ba0561.tar.bz2 |
[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (4)
There's a pattern:
...
gdb_test <command> <pattern> <command>
...
that can be written shorter as:
...
gdb_test <command> <pattern>
...
Detect this pattern in proc gdb_test:
...
global gdb_prompt
upvar timeout timeout
if [llength $args]>2 then {
set message [lindex $args 2]
+ if { $message == [lindex $args 0] && [llength $args] == 3 } {
+ error "HERE"
+ }
} else {
set message [lindex $args 0]
}
...
and fix all occurrences in the testsuite/gdb.base subdir.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-11-02 Tom de Vries <tdevries@suse.de>
* gdb.base/advance.exp: Drop superfluous 3rd argument to gdb_test.
* gdb.base/anon.exp: Same.
* gdb.base/auto-connect-native-target.exp: Same.
* gdb.base/call-ar-st.exp: Same.
* gdb.base/catch-syscall.exp: Same.
* gdb.base/commands.exp: Same.
* gdb.base/default.exp: Same.
* gdb.base/display.exp: Same.
* gdb.base/float.exp: Same.
* gdb.base/foll-fork.exp: Same.
* gdb.base/help.exp: Same.
* gdb.base/info-macros.exp: Same.
* gdb.base/info-proc.exp: Same.
* gdb.base/info-target.exp: Same.
* gdb.base/long_long.exp: Same.
* gdb.base/macscp.exp: Same.
* gdb.base/memattr.exp: Same.
* gdb.base/nofield.exp: Same.
* gdb.base/pointers.exp: Same.
* gdb.base/printcmds.exp: Same.
* gdb.base/ptype.exp: Same.
* gdb.base/restore.exp: Same.
* gdb.base/return.exp: Same.
* gdb.base/scope.exp: Same.
* gdb.base/set-noassign.exp: Same.
* gdb.base/setshow.exp: Same.
* gdb.base/shlib-call.exp: Same.
* gdb.base/signals.exp: Same.
* gdb.base/sigstep.exp: Same.
* gdb.base/skip.exp: Same.
* gdb.base/solib-symbol.exp: Same.
* gdb.base/stap-probe.exp: Same.
* gdb.base/step-line.exp: Same.
* gdb.base/step-test.exp: Same.
* gdb.base/style.exp: Same.
* gdb.base/varargs.exp: Same.
* gdb.base/vla-datatypes.exp: Same.
* gdb.base/vla-ptr.exp: Same.
* gdb.base/vla-sideeffect.exp: Same.
* gdb.base/volatile.exp: Same.
* gdb.base/watch-cond-infcall.exp: Same.
* gdb.base/watchpoint.exp: Same.
Change-Id: Ifd24dc13d552e7dd03f9049db419b08c6adc4112
Diffstat (limited to 'gdb/testsuite/gdb.base/info-macros.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/info-macros.exp | 59 |
1 files changed, 20 insertions, 39 deletions
diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp index e2385fa..534a12e 100644 --- a/gdb/testsuite/gdb.base/info-macros.exp +++ b/gdb/testsuite/gdb.base/info-macros.exp @@ -42,70 +42,53 @@ if ![runto_main] { # Test various error messages. gdb_test "info macro -- -all" \ - "The symbol `-all' has no definition .*\r\nat .*$srcfile:\[0-9\]+" \ - "info macro -- -all" + "The symbol `-all' has no definition .*\r\nat .*$srcfile:\[0-9\]+" gdb_test "info macro -- -all" \ - "The symbol `-all' has no definition .*\r\nat .*$srcfile:\[0-9\]+" \ - "info macro -- -all" + "The symbol `-all' has no definition .*\r\nat .*$srcfile:\[0-9\]+" gdb_test "info macro -all --" \ - "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \ - "info macro -all --" + "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" gdb_test "info macro -all --" \ - "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \ - "info macro -all --" + "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" gdb_test "info macro -all --" \ - "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \ - "info macro -all --" + "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" gdb_test "info macro --" \ - "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \ - "info macro --" + "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" gdb_test "info macro -- " \ - "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \ - "'info macro -- '" + "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" gdb_test "info macro -- " \ - "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \ - "'info macro -- '" + "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" gdb_test "info macro -invalid-option" \ - "Unrecognized option.*Try \"help info macro\"\." \ - "info macro -invalid-option 1" + "Unrecognized option.*Try \"help info macro\"\." gdb_test "info macro -invalid-option" \ - "Unrecognized option.*Try \"help info macro\"\." \ - "info macro -invalid-option" + "Unrecognized option.*Try \"help info macro\"\." gdb_test "info macro -invalid-option FOO" \ - "Unrecognized option.*Try \"help info macro\"\." \ - "info macro -invalid-option FOO" + "Unrecognized option.*Try \"help info macro\"\." gdb_test "info macro -invalid-option FOO" \ - "Unrecognized option.*Try \"help info macro\"\." \ - "info macro -invalid-option FOO" + "Unrecognized option.*Try \"help info macro\"\." # Single macro lookups. gdb_test "info macro -- FOO" \ - ".*#define FOO \"hello\"" \ - "info macro -- FOO" + ".*#define FOO \"hello\"" gdb_test "info macro -- FOO" \ - ".*#define FOO \"hello\"" \ - "info macro -- FOO" + ".*#define FOO \"hello\"" gdb_test "info macro -- FOO" \ - ".*#define FOO \"hello\"" \ - "info macro -- FOO" + ".*#define FOO \"hello\"" gdb_test "info macro FOO" \ - ".*#define FOO \"hello\"" \ - "info macro FOO" + ".*#define FOO \"hello\"" gdb_test "info macro FOO" \ - ".*#define FOO \"hello\"" \ - "info macro FOO" + ".*#define FOO \"hello\"" # Multiple macro lookups. set test "info macro -a FOO" @@ -125,12 +108,10 @@ set testname "$test 1" gdb_test "$test" "$r1$r2$r3$r4" "$testname" set test "info macro -a -- FOO" -set testname "$test" -gdb_test "$test" "$r1$r2$r3$r4" "$testname" +gdb_test "$test" "$r1$r2$r3$r4" set test "info macro -a -- FOO" -set testname "$test" -gdb_test "$test" "$r1$r2$r3$r4" "$testname" +gdb_test "$test" "$r1$r2$r3$r4" proc gdb_test_multiple_with_read1_timeout_factor { factor command message \ user_code } { @@ -295,4 +276,4 @@ set r2 ".*define ONE" # info macros on the line where the #define or #include is # fails to find the macro defined (though it works on the next line.) setup_kfail "gdb/NNNN" *-*-* -gdb_test "$test" "$r1$r2" "$test" +gdb_test "$test" "$r1$r2" |