[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call
authorTom de Vries <tdevries@suse.de>
Thu, 31 Oct 2019 16:37:02 +0000 (17:37 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 31 Oct 2019 16:37:02 +0000 (17:37 +0100)
commit3d11e68e4b0a557bf2f2fdaad188667215ec5aaa
tree2b81fb083ab9b02b4357e97781c229a1f2bccea8
parente20f9590e78473b3b944d606c28a519094eedea0
[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call

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] } {
+     error "HERE"
+ }
     } else {
  set message [lindex $args 0]
     }
...
and fix all occurences in gdb.ada.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-10-31  Tom de Vries  <tdevries@suse.de>

* gdb.ada/array_bounds.exp: Drop superfluous 3rd argument to gdb_test.
* gdb.ada/array_subscript_addr.exp: Same.
* gdb.ada/arrayidx.exp: Same.
* gdb.ada/arrayparam.exp: Same.
* gdb.ada/arrayptr.exp: Same.
* gdb.ada/boolean_expr.exp: Same.
* gdb.ada/call_pn.exp: Same.
* gdb.ada/complete.exp: Same.
* gdb.ada/fixed_cmp.exp: Same.
* gdb.ada/fun_addr.exp: Same.
* gdb.ada/funcall_param.exp: Same.
* gdb.ada/interface.exp: Same.
* gdb.ada/mod_from_name.exp: Same.
* gdb.ada/null_array.exp: Same.
* gdb.ada/packed_array.exp: Same.
* gdb.ada/packed_tagged.exp: Same.
* gdb.ada/print_chars.exp: Same.
* gdb.ada/print_pc.exp: Same.
* gdb.ada/ptype_arith_binop.exp: Same.
* gdb.ada/ptype_field.exp: Same.
* gdb.ada/ptype_tagged_param.exp: Same.
* gdb.ada/rec_return.exp: Same.
* gdb.ada/ref_tick_size.exp: Same.
* gdb.ada/str_ref_cmp.exp: Same.
* gdb.ada/taft_type.exp: Same.
* gdb.ada/tagged.exp: Same.
* gdb.ada/type_coercion.exp: Same.
* gdb.ada/uninitialized_vars.exp: Same.

Change-Id: Ibb84a41573c7f21295f3fd42da9b96534205c5c4
29 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/array_bounds.exp
gdb/testsuite/gdb.ada/array_subscript_addr.exp
gdb/testsuite/gdb.ada/arrayidx.exp
gdb/testsuite/gdb.ada/arrayparam.exp
gdb/testsuite/gdb.ada/arrayptr.exp
gdb/testsuite/gdb.ada/boolean_expr.exp
gdb/testsuite/gdb.ada/call_pn.exp
gdb/testsuite/gdb.ada/complete.exp
gdb/testsuite/gdb.ada/fixed_cmp.exp
gdb/testsuite/gdb.ada/fun_addr.exp
gdb/testsuite/gdb.ada/funcall_param.exp
gdb/testsuite/gdb.ada/interface.exp
gdb/testsuite/gdb.ada/mod_from_name.exp
gdb/testsuite/gdb.ada/null_array.exp
gdb/testsuite/gdb.ada/packed_array.exp
gdb/testsuite/gdb.ada/packed_tagged.exp
gdb/testsuite/gdb.ada/print_chars.exp
gdb/testsuite/gdb.ada/print_pc.exp
gdb/testsuite/gdb.ada/ptype_arith_binop.exp
gdb/testsuite/gdb.ada/ptype_field.exp
gdb/testsuite/gdb.ada/ptype_tagged_param.exp
gdb/testsuite/gdb.ada/rec_return.exp
gdb/testsuite/gdb.ada/ref_tick_size.exp
gdb/testsuite/gdb.ada/str_ref_cmp.exp
gdb/testsuite/gdb.ada/taft_type.exp
gdb/testsuite/gdb.ada/tagged.exp
gdb/testsuite/gdb.ada/type_coercion.exp
gdb/testsuite/gdb.ada/uninitialized_vars.exp