]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/gdb.cp/pr17132.exp
[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (3)
authorTom de Vries <tdevries@suse.de>
Sat, 2 Nov 2019 05:55:10 +0000 (06:55 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 2 Nov 2019 05:55:10 +0000 (06:55 +0100)
commite96ec2bab75a943e1666497b1389e297775af5a8
treeecdcae9acb1be8ac126064a7c96673a29db81d37
parenta1dc3a23d0507ef32f36844ef771cd9189168be1
[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (3)

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.cp subdir.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-11-02  Tom de Vries  <tdevries@suse.de>

* gdb.cp/anon-union.exp: Drop superfluous 3rd argument to gdb_test.
* gdb.cp/cpexprs.exp: Same.
* gdb.cp/except-multi-location.exp: Same.
* gdb.cp/exceptprint.exp: Same.
* gdb.cp/gdb2384.exp: Same.
* gdb.cp/inherit.exp: Same.
* gdb.cp/m-static.exp: Same.
* gdb.cp/meth-typedefs.exp: Same.
* gdb.cp/misc.exp: Same.
* gdb.cp/namespace.exp: Same.
* gdb.cp/non-trivial-retval.exp: Same.
* gdb.cp/overload.exp: Same.
* gdb.cp/pr17132.exp: Same.
* gdb.cp/re-set-overloaded.exp: Same.
* gdb.cp/rvalue-ref-types.exp: Same.
* gdb.cp/templates.exp: Same.

Change-Id: I0254d0cea71e7376aedb078166188a8010eeaebe
17 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/anon-union.exp
gdb/testsuite/gdb.cp/cpexprs.exp
gdb/testsuite/gdb.cp/except-multi-location.exp
gdb/testsuite/gdb.cp/exceptprint.exp
gdb/testsuite/gdb.cp/gdb2384.exp
gdb/testsuite/gdb.cp/inherit.exp
gdb/testsuite/gdb.cp/m-static.exp
gdb/testsuite/gdb.cp/meth-typedefs.exp
gdb/testsuite/gdb.cp/misc.exp
gdb/testsuite/gdb.cp/namespace.exp
gdb/testsuite/gdb.cp/non-trivial-retval.exp
gdb/testsuite/gdb.cp/overload.exp
gdb/testsuite/gdb.cp/pr17132.exp
gdb/testsuite/gdb.cp/re-set-overloaded.exp
gdb/testsuite/gdb.cp/rvalue-ref-types.exp
gdb/testsuite/gdb.cp/templates.exp