public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Remove some duplicate test names
@ 2019-09-16  2:25 Andrew Burgess
  2019-09-16  2:25 ` [PATCH 4/4] gdb/testsuite: Reduce test name duplication in gdb.python tests Andrew Burgess
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Andrew Burgess @ 2019-09-16  2:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

This series removes some (~65%) of the test name duplication we have
within the testsuite.  The following table shows the number of
duplicate test names broken down by test script directory before and
after this patch series:

    | TEST NAME    | BEFORE | AFTER |
    |--------------+--------+-------|
    | gdb.reverse  |    825 |     0 |
    | gdb.base     |    454 |   145 |
    | gdb.python   |    174 |    85 |
    | gdb.cp       |    127 |   127 |
    | gdb.guile    |     81 |    81 |
    | gdb.mi       |     69 |    69 |
    | gdb.arch     |     61 |    61 |
    | gdb.btrace   |     45 |    45 |
    | gdb.linespec |     43 |     0 |
    | gdb.dwarf2   |     15 |    15 |
    | gdb.threads  |     14 |    14 |
    | gdb.multi    |     11 |    11 |
    | gdb.ada      |      8 |     8 |
    | gdb.rust     |      7 |     7 |
    | gdb.fortran  |      4 |     4 |
    | gdb.trace    |      3 |     3 |
    | gdb.xml      |      1 |     1 |
    | gdb.gdb      |      1 |     1 |
    |--------------+--------+-------|
    | Total        |   1943 |   677 |

Where possible I've tried to avoid huge amounts of churn in the test
scripts, but sometimes adding a 'with_test_prefix' was the easiest way
to make test names unique, which obviously then requires me to
reindent a block of code.

When I can I've tried to give tests useful unique names, but sometimes
I couldn't see anything other than to just mark tests with "first
time", "second time", etc.  There was plenty of this sort of thing
going on already in the tests, so I don't feel too bad.

---

Andrew Burgess (4):
  gdb/testsuite: Make test names unique in gdb.reverse tests
  gdb/testsuite: Make test names unique in gdb.linespec tests
  gdb/testsuite: Reduce test name duplication in gdb.base tests
  gdb/testsuite: Reduce test name duplication in gdb.python tests

 gdb/testsuite/ChangeLog                            |  39 +++
 gdb/testsuite/gdb.base/break-interp.exp            |  76 +++--
 gdb/testsuite/gdb.base/call-sc.exp                 |  10 +-
 gdb/testsuite/gdb.base/callfuncs.exp               |  46 +--
 gdb/testsuite/gdb.base/charset.exp                 |  10 +-
 gdb/testsuite/gdb.base/dump.exp                    |  42 +--
 gdb/testsuite/gdb.base/ena-dis-br.exp              |  12 +-
 gdb/testsuite/gdb.base/relational.exp              | 193 +++++++------
 gdb/testsuite/gdb.base/step-over-syscall.exp       |  11 +-
 gdb/testsuite/gdb.base/structs.exp                 |  10 +-
 gdb/testsuite/gdb.linespec/explicit.exp            |   6 +-
 gdb/testsuite/gdb.linespec/ls-errs.exp             |   5 +-
 gdb/testsuite/gdb.python/py-parameter.exp          | 317 ++++++++++++---------
 gdb/testsuite/gdb.python/py-template.exp           |   8 +-
 gdb/testsuite/gdb.python/py-value.exp              |  58 ++--
 gdb/testsuite/gdb.reverse/break-precsave.exp       |  12 +-
 gdb/testsuite/gdb.reverse/break-reverse.exp        |  15 +-
 gdb/testsuite/gdb.reverse/finish-precsave.exp      |  18 +-
 gdb/testsuite/gdb.reverse/finish-reverse.exp       |  18 +-
 .../gdb.reverse/machinestate-precsave.exp          |   6 +-
 gdb/testsuite/gdb.reverse/machinestate.exp         |   6 +-
 gdb/testsuite/gdb.reverse/readv-reverse.exp        |   8 +-
 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp      |   6 +-
 gdb/testsuite/gdb.reverse/sigall-precsave.exp      |  14 +-
 gdb/testsuite/gdb.reverse/sigall-reverse.exp       |  14 +-
 .../gdb.reverse/step-indirect-call-thunk.exp       |   4 +-
 gdb/testsuite/gdb.reverse/watch-precsave.exp       |   6 +-
 gdb/testsuite/gdb.reverse/watch-reverse.exp        |   6 +-
 28 files changed, 593 insertions(+), 383 deletions(-)

-- 
2.14.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/4] gdb/testsuite: Reduce test name duplication in gdb.base tests
  2019-09-16  2:25 [PATCH 0/4] Remove some duplicate test names Andrew Burgess
  2019-09-16  2:25 ` [PATCH 4/4] gdb/testsuite: Reduce test name duplication in gdb.python tests Andrew Burgess
@ 2019-09-16  2:25 ` Andrew Burgess
  2019-09-16  2:25 ` [PATCH 2/4] gdb/testsuite: Make test names unique in gdb.linespec tests Andrew Burgess
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2019-09-16  2:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

This commit removes some, but not all, of the test name duplication
within the gdb.base tests.  On my local machine this takes the number
of duplicate test names in this set of tests from 454 to 145.  It is
possible that different setups might encounter more duplicate tests.

gdb/testsuite/ChangeLog:

	* gdb.base/break-interp.exp: Reduce test name duplication.
	* gdb.base/call-sc.exp: Likewise.
	* gdb.base/callfuncs.exp: Likewise.
	* gdb.base/charset.exp: Likewise.
	* gdb.base/dump.exp: Likewise.
	* gdb.base/ena-dis-br.exp: Likewise.
	* gdb.base/relational.exp: Likewise.
	* gdb.base/step-over-syscall.exp: Likewise.
	* gdb.base/structs.exp: Likewise.
---
 gdb/testsuite/ChangeLog                      |  12 ++
 gdb/testsuite/gdb.base/break-interp.exp      |  76 ++++++-----
 gdb/testsuite/gdb.base/call-sc.exp           |  10 +-
 gdb/testsuite/gdb.base/callfuncs.exp         |  46 ++++---
 gdb/testsuite/gdb.base/charset.exp           |  10 +-
 gdb/testsuite/gdb.base/dump.exp              |  42 +++---
 gdb/testsuite/gdb.base/ena-dis-br.exp        |  12 +-
 gdb/testsuite/gdb.base/relational.exp        | 193 +++++++++++++++------------
 gdb/testsuite/gdb.base/step-over-syscall.exp |  11 +-
 gdb/testsuite/gdb.base/structs.exp           |  10 +-
 10 files changed, 248 insertions(+), 174 deletions(-)

diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index d6da6535293..a03c9f43fda 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -191,8 +191,16 @@ proc reach_1 {func command displacement} {
 # DISPLACEMENT can be "NONE" for no message to be present, "ZERO" for
 # displacement of 0 bytes to be present, "NONZERO" for displacement of non-0
 # bytes to be present and "PRESENT" if both "ZERO" and "NONZERO" are valid.
-proc reach {func command displacement} {
-    with_test_prefix "reach-$func" {
+#
+# The optional ITERATION parameter is used in order to make unique
+# test prefixes, when calling this proc with the same FUNC name
+# provide a unique ITERATION value for each call.
+proc reach {func command displacement {iteration 1}} {
+    set prefix "reach-$func"
+    if { $iteration > 1 } {
+	set prefix "$prefix-$iteration"
+    }
+    with_test_prefix $prefix {
 	reach_1 $func $command $displacement
     }
 }
@@ -399,7 +407,7 @@ proc test_ld {file ifmain trynosym displacement} {
 	    "set args OBJDIR/${subdir}/$binfile_test"
     }
 
-    reach $solib_bp "run" $displacement
+    reach $solib_bp "run" $displacement 1
 
     gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?$solib_bp\\M.*" "dl bt"
 
@@ -413,7 +421,7 @@ proc test_ld {file ifmain trynosym displacement} {
 
     # Try re-run if the new PIE displacement takes effect.
     gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
-    reach $solib_bp "run" $displacement
+    reach $solib_bp "run" $displacement 2
 
     if $ifmain {
 	test_core $file $displacement
@@ -445,7 +453,7 @@ proc test_ld {file ifmain trynosym displacement} {
 	gdb_test "exec-file $file" "exec-file $escapedfile" "load"
 
 	if $ifmain {
-	    reach $solib_bp run $displacement
+	    reach $solib_bp run $displacement 3
 
 	    # Use two separate gdb_test_multiple statements to avoid timeouts due
 	    # to slow processing of wildcard capturing long output
@@ -594,9 +602,10 @@ foreach ldprelink {NO YES} {
 		file delete "${interp}.debug"
 	    }
 
-	    if ![prelink$ldprelink $interp] {
+	    if ![prelink$ldprelink $interp "$interp, second time"] {
 		continue
 	    }
+
 	    if {$ldprelink == "NO"} {
 		set displacement "NONZERO"
 	    } else {
@@ -662,34 +671,39 @@ foreach ldprelink {NO YES} {
 
 			    if {[prelink$binprelink $relink_args [file tail $exec]]
 				&& [file_copy $interp_saved $interp]} {
-				if {$binpie != "ATTACH"} {
-				    test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
-				} else {
-				    # If the file has been randomly prelinked it must be
-				    # "NONZERO".  We could see "ZERO" only if it was unprelinked
-				    # and it is now running at the same address - which is 0 but
-				    # executable can never run at address 0.
-
-				    set displacement "NONZERO"
-				    test_attach $exec $displacement $relink_args
-
-				    # ATTACH means that executables and libraries have been
-				    # modified after they have been run.  They cannot be reused
-				    # for problem reproducibility after the testcase ends in
-				    # the ATTACH case.  Therefore they are rather deleted not
-				    # to confuse after the run finishes.
-				    set exec_debug [system_debug_get $exec]
-				    if {$exec_debug != ""} {
-					# `file delete [glob "${exec_debug}*"]' does not work.
-					foreach f [glob "${exec_debug}*"] {
+				# In order to make test names unique wrap the core of this if block
+				# with a test prefix.  Some of the tests performed in the if
+				# condition are repeated within this body.
+				with_test_prefix "INNER" {
+				    if {$binpie != "ATTACH"} {
+					test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
+				    } else {
+					# If the file has been randomly prelinked it must be
+					# "NONZERO".  We could see "ZERO" only if it was unprelinked
+					# and it is now running at the same address - which is 0 but
+					# executable can never run at address 0.
+
+					set displacement "NONZERO"
+					test_attach $exec $displacement $relink_args
+
+					# ATTACH means that executables and libraries have been
+					# modified after they have been run.  They cannot be reused
+					# for problem reproducibility after the testcase ends in
+					# the ATTACH case.  Therefore they are rather deleted not
+					# to confuse after the run finishes.
+					set exec_debug [system_debug_get $exec]
+					if {$exec_debug != ""} {
+					    # `file delete [glob "${exec_debug}*"]' does not work.
+					    foreach f [glob "${exec_debug}*"] {
+						file delete $f
+					    }
+					}
+					file delete -force $dir
+					# `file delete [glob "${exec}*"]' does not work.
+					foreach f [glob "${exec}*"] {
 					    file delete $f
 					}
 				    }
-				    file delete -force $dir
-				    # `file delete [glob "${exec}*"]' does not work.
-				    foreach f [glob "${exec}*"] {
-					file delete $f
-				    }
 				}
 			    }
 			}
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index c68dfeb3688..6cb67f85ae3 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -71,9 +71,11 @@ proc start_scalars_test { type } {
     gdb_load ${binfile}
 
     # Make certain that the output is consistent
-    gdb_test_no_output "set print sevenbit-strings"
-    gdb_test_no_output "set print address off"
-    gdb_test_no_output "set width 0"
+    with_test_prefix "testfile=$testfile" {
+	gdb_test_no_output "set print sevenbit-strings"
+	gdb_test_no_output "set print address off"
+	gdb_test_no_output "set width 0"
+    }
 
     # Advance to main
     if { ![runto_main] } then {
@@ -243,7 +245,7 @@ proc test_scalar_returns { } {
     #
     # This happens on ppc64 GNU/Linux with gcc 3.4.1 and a buggy GDB
 
-    set test "return foo; synchronize pc to main()"
+    set test "return foo; synchronize pc to main() for '${testfile}'"
     for {set loop_count 0} {$loop_count < 2} {incr loop_count} {
       gdb_test_multiple "backtrace 1" $test {
         -re "#0.*main \\(\\).*${gdb_prompt} $" {
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index f9e4c432c80..04bdac85e73 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -322,21 +322,30 @@ proc fetch_all_registers {test} {
     return $all_registers_lines
 }
 
+set rerun_count 0
+
 proc rerun_and_prepare {} {
-    if { ![runto_main] } {
-	gdb_suppress_tests
-    }
+    global rerun_count
+
+    incr rerun_count
+    with_test_prefix "rerun number ${rerun_count}" {
 
-    gdb_test_no_output "set language c"
+	if { ![runto_main] } {
+	    gdb_suppress_tests
+	}
+
+	gdb_test_no_output "set language c"
 
-    get_debug_format
+	get_debug_format
 
-    # Make sure that malloc gets called and that the floating point unit
-    # is initialized via a call to t_double_values.
-    gdb_test "next" "t_double_values\\(double_val1, double_val2\\);.*" \
-	"next to t_double_values"
-    gdb_test "next" "t_structs_c\\(struct_val1\\);.*" \
-	"next to t_structs_c"
+	# Make sure that malloc gets called and that the floating
+	# point unit is initialized via a call to t_double_values.
+	gdb_test "next" \
+	    "t_double_values\\(double_val1, double_val2\\);.*" \
+	    "next to t_double_values"
+	gdb_test "next" "t_structs_c\\(struct_val1\\);.*" \
+	    "next to t_structs_c"
+    }
 }
 
 proc perform_all_tests {prototypes} {
@@ -347,7 +356,8 @@ proc perform_all_tests {prototypes} {
     rerun_and_prepare
 
     # Save all register contents.
-    set old_reg_content [fetch_all_registers "retrieve original register contents"]
+    set old_reg_content \
+	[fetch_all_registers "retrieve original register contents 1"]
 
     # Perform function calls.
     do_function_calls $prototypes
@@ -364,7 +374,8 @@ proc perform_all_tests {prototypes} {
 
     rerun_and_prepare
     # Save all register contents.
-    set old_reg_content [fetch_all_registers "retrieve original register contents"]
+    set old_reg_content \
+	[fetch_all_registers "retrieve original register contents 2"]
 
     # Set breakpoint at a function we will call from gdb.
     gdb_breakpoint add
@@ -391,7 +402,8 @@ proc perform_all_tests {prototypes} {
     # Set breakpoint at a function we will call from gdb.
     gdb_breakpoint add
     # Save all register contents.
-    set old_reg_content [fetch_all_registers "retrieve original register contents"]
+    set old_reg_content \
+	[fetch_all_registers "retrieve original register contents 3"]
 
     # Call function (causing a breakpoint hit in the call dummy) and do a finish,
     # make sure we are back at main and still have the same register contents.
@@ -416,7 +428,8 @@ proc perform_all_tests {prototypes} {
     # Set breakpoint at a function we will call from gdb.
     gdb_breakpoint add
     # Save all register contents.
-    set old_reg_content [fetch_all_registers "retrieve original register contents"]
+    set old_reg_content \
+	[fetch_all_registers "retrieve original register contents 4"]
 
     # Call function (causing a breakpoint hit in the call dummy) and do a return
     # with a value, make sure we are back at main with the same register contents.
@@ -439,7 +452,8 @@ proc perform_all_tests {prototypes} {
     rerun_and_prepare
     # Set breakpoint at a function we will call from gdb.
     gdb_breakpoint add
-    set old_reg_content [fetch_all_registers "retrieve original register contents"]
+    set old_reg_content \
+	[fetch_all_registers "retrieve original register contents 5"]
 
     # Call function (causing a breakpoint hit in the call dummy), and
     # call another function from the call dummy frame (thereby setting up
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 72c7439ebd5..16e986c5190 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -175,7 +175,7 @@ gdb_expect {
 # We don't want to test all the charset names here, since that would
 # be too many combinations.  We we pick a subset.
 set charset_subset {ASCII ISO-8859-1 EBCDIC-US IBM1047}
-foreach host_charset $charset_subset {
+foreach_with_prefix host_charset $charset_subset {
     if {[valid_host_charset $host_charset]} {
 
         set testname "try `set host-charset $host_charset'"
@@ -591,8 +591,12 @@ gdb_test "print 'a' == 'a' || 'b' == 'b'" \
 
 
 proc string_display { var_name set_prefix x_size x_type} {
-  gdb_test_no_output "set ${var_name} = ${set_prefix}\"Test String\\0with zeroes\"" "assign ${var_name} with prefix ${set_prefix}"
-  gdb_test "x /2${x_size}s ${var_name}" ".*\t${x_type}\"Test String\"\[\r\n\]+.*\t${x_type}\"with zeroes\"" "display String ${var_name} with x/${x_size}s"
+    with_test_prefix "set_prefix=$set_prefix" {
+	gdb_test_no_output "set ${var_name} = ${set_prefix}\"Test String\\0with zeroes\""\
+	    "assign ${var_name} with prefix ${set_prefix}"
+	gdb_test "x /2${x_size}s ${var_name}" ".*\t${x_type}\"Test String\"\[\r\n\]+.*\t${x_type}\"with zeroes\"" \
+	    "display String ${var_name} with x/${x_size}s"
+    }
 }
 
 if {$ucs2_ok} {
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index 52ba5f8ebe3..e2310375fef 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -36,6 +36,15 @@ if {[istarget "spu*-*-*"]} then {
     set is64bitonly "yes"
 }
 
+set print_zero_all_count 0
+proc print_zero_all { } {
+    global print_zero_all_count
+
+    incr print_zero_all_count
+    gdb_test "print zero_all ()" " = void" \
+	"call ${print_zero_all_count} to zero_all function"
+}
+
 # Debian9/Ubuntu16.10 onwards default to PIE enabled. Ensure it is disabled as
 # this causes addresses to be out of range for IHEX.
 lappend options {nopie}
@@ -278,7 +287,6 @@ proc test_restore_saved_value { restore_args msg oldval newval } {
 
 if ![string compare $is64bitonly "no"] then {
 
-  gdb_test "print zero_all ()" ".*"
 
   test_restore_saved_value "[set intarr1.srec]" "array as value, srec" \
 	$array_val "intarray"
@@ -286,7 +294,7 @@ if ![string compare $is64bitonly "no"] then {
   test_restore_saved_value "[set intstr1.srec]" "struct as value, srec" \
 	$struct_val "intstruct"
 
-  gdb_test "print zero_all ()" "void" "zero all"
+  print_zero_all
 
   test_restore_saved_value "[set intarr2.srec]" "array as memory, srec" \
 	$array_val "intarray"
@@ -294,7 +302,7 @@ if ![string compare $is64bitonly "no"] then {
   test_restore_saved_value "[set intstr2.srec]" "struct as memory, srec" \
 	$struct_val "intstruct"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.ihex]" "array as value, ihex" \
 	$array_val "intarray"
@@ -302,7 +310,7 @@ if ![string compare $is64bitonly "no"] then {
   test_restore_saved_value "[set intstr1.ihex]" "struct as value, ihex" \
 	$struct_val "intstruct"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr2.ihex]" "array as memory, ihex" \
 	$array_val "intarray"
@@ -310,7 +318,7 @@ if ![string compare $is64bitonly "no"] then {
   test_restore_saved_value "[set intstr2.ihex]" "struct as memory, ihex" \
 	$struct_val "intstruct"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.tekhex]" "array as value, tekhex" \
 	$array_val "intarray"
@@ -318,7 +326,7 @@ if ![string compare $is64bitonly "no"] then {
   test_restore_saved_value "[set intstr1.tekhex]" "struct as value, tekhex" \
 	$struct_val "intstruct"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr2.tekhex]" "array as memory, tekhex" \
 	$array_val "intarray"
@@ -327,7 +335,7 @@ if ![string compare $is64bitonly "no"] then {
 	$struct_val "intstruct"
 }
 
-gdb_test "print zero_all ()" ".*"
+print_zero_all
 
 test_restore_saved_value "[set intarr1.bin] binary $array_start" \
 	"array as value, binary" \
@@ -337,7 +345,7 @@ test_restore_saved_value "[set intstr1.bin] binary $struct_start" \
 	"struct as value, binary" \
 	$struct_val "intstruct"
 
-gdb_test "print zero_all ()" ".*"
+print_zero_all
 
 test_restore_saved_value "[set intarr2.bin] binary $array_start" \
 	"array as memory, binary" \
@@ -356,7 +364,7 @@ set array2_offset  \
 set struct2_offset \
 	[capture_value "(char *) &intstruct2 - (char *) &intstruct"]
 
-gdb_test "print zero_all ()" ".*"
+print_zero_all
 
 
 if ![string compare $is64bitonly "no"] then {
@@ -368,7 +376,7 @@ if ![string compare $is64bitonly "no"] then {
 	"struct copy, srec" \
 	$struct_val "intstruct2"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.ihex] $array2_offset" \
 	"array copy, ihex" \
@@ -378,7 +386,7 @@ if ![string compare $is64bitonly "no"] then {
 	"struct copy, ihex" \
 	$struct_val "intstruct2"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.tekhex] $array2_offset" \
 	"array copy, tekhex" \
@@ -389,7 +397,7 @@ if ![string compare $is64bitonly "no"] then {
 	$struct_val "intstruct2"
 }
 
-gdb_test "print zero_all ()" ".*"
+print_zero_all
 
 test_restore_saved_value "[set intarr1.bin] binary $array2_start" \
 	"array copy, binary" \
@@ -416,7 +424,7 @@ set element4_offset \
 	[capture_value "/x (char *) &intarray\[4\] - (char *) &intarray\[0\]"]
 
 if ![string compare $is64bitonly "no"] then {
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.srec] 0 $element3_start $element4_start" \
 	"array partial, srec" 4 "intarray\[3\]"
@@ -424,7 +432,7 @@ if ![string compare $is64bitonly "no"] then {
   gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 1"
   gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 1"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.ihex] 0 $element3_start $element4_start" \
 	"array partial, ihex" 4 "intarray\[3\]"
@@ -432,7 +440,7 @@ if ![string compare $is64bitonly "no"] then {
   gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 2"
   gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 2"
 
-  gdb_test "print zero_all ()" ".*"
+  print_zero_all
 
   test_restore_saved_value "[set intarr1.tekhex] 0 $element3_start $element4_start" \
 	"array partial, tekhex" 4 "intarray\[3\]"
@@ -441,7 +449,7 @@ if ![string compare $is64bitonly "no"] then {
   gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 3"
 }
 
-gdb_test "print zero_all ()" ".*"
+print_zero_all
 
 test_restore_saved_value \
     "[set intarr1.bin] binary $array_start $element3_offset $element4_offset" \
@@ -451,7 +459,7 @@ gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 4"
 gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
 
 if ![string compare $is64bitonly "no"] then {
-  gdb_test "print zero_all ()" ".*" ""
+  print_zero_all
 
   # restore with expressions 
   test_restore_saved_value \
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index aa5b35e3586..cd05052a0ee 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -60,7 +60,7 @@ gdb_test_no_output "enable $bp" "enable break marker1"
 
 gdb_test "info break $bp" \
     "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y.*" \
-    "info break marker1"
+    "info break marker1 before hitting breakpoint"
 
 # See the comments in condbreak.exp for "run until breakpoint at
 # marker1" for an explanation of the xfail below.
@@ -84,7 +84,7 @@ gdb_test_no_output "enable once $bp" "enable once break marker2"
 
 gdb_test "info break $bp" \
     "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+dis\[ \t\]+y.*" \
-    "info auto-disabled break marker2"
+    "info auto-disabled break marker2 before hitting breakpoint"
 
 # See the comments in condbreak.exp for "run until breakpoint at
 # marker1" for an explanation of the xfail below.
@@ -100,7 +100,7 @@ gdb_test_multiple "continue" "$test" {
 
 gdb_test "info break $bp" \
     "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+dis\[ \t\]+n.*" \
-    "info auto-disabled break marker2"
+    "info auto-disabled break marker2 after hitting breakpoint"
 
 # Verify that we don't stop at a disabled breakpoint.
 gdb_continue_to_end "no stop"
@@ -209,7 +209,7 @@ gdb_test "ignore $bp 0" \
 
 gdb_test "ignore $bp 1" \
     "Will ignore next crossing of breakpoint \[0-9\]*.*" \
-    "ignore break marker1"
+    "ignore break marker1 1"
 
 gdb_test "info break $bp" \
     "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y.*ignore next 1 hits.*" \
@@ -246,7 +246,7 @@ gdb_test_no_output "enable del $bp" "enable del break marker1"
 
 gdb_test "info break $bp" \
     "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+del\[ \t\]+y.*ignore next 1 hits.*" \
-    "info break marker1"
+    "info break marker1 after hitting breakpoint"
 
 gdb_continue_to_end "no stop at ignored & auto-deleted break marker1"
 rerun_to_main
@@ -266,7 +266,7 @@ set bp [break_at marker1 " line $bp_location15"]
 
 gdb_test "ignore $bp 10" \
     "Will ignore next 10 crossings of breakpoint \[0-9\]*.*" \
-    "ignore break marker1"
+    "ignore break marker1 10"
 
 gdb_test_no_output "disable $bp" "disable break marker1"
 
diff --git a/gdb/testsuite/gdb.base/relational.exp b/gdb/testsuite/gdb.base/relational.exp
index 054c6259d4d..eb8e0a717f8 100644
--- a/gdb/testsuite/gdb.base/relational.exp
+++ b/gdb/testsuite/gdb.base/relational.exp
@@ -46,147 +46,162 @@ if ![runto_main] then {
 # test expressions with "int" types
 #
 
-gdb_test_no_output "set variable x=14" "set variable x=14"
-gdb_test_no_output "set variable y=2" "set variable y=2"
-gdb_test_no_output "set variable z=2" "set variable z=2"
-gdb_test_no_output "set variable w=3" "set variable w=3"
+with_test_prefix "int types" {
 
-gdb_test "print x" " = 14" "print value of x"
+    gdb_test_no_output "set variable x=14" "set variable x=14"
+    gdb_test_no_output "set variable y=2" "set variable y=2"
+    gdb_test_no_output "set variable z=2" "set variable z=2"
+    gdb_test_no_output "set variable w=3" "set variable w=3"
 
-gdb_test "print y" " = 2" "print value of y"
+    gdb_test "print x" " = 14" "print value of x"
 
-gdb_test "print z" " = 2" "print value of z"
+    gdb_test "print y" " = 2" "print value of y"
 
-gdb_test "print w" " = 3" "print value of w"
+    gdb_test "print z" " = 2" "print value of z"
 
-gdb_test "print x < y" "$false" "print value of x<y"
+    gdb_test "print w" " = 3" "print value of w"
 
-gdb_test "print x <= y" "$false" "print value of x<=y"
+    gdb_test "print x < y" "$false" "print value of x<y"
 
-gdb_test "print x > y" "$true" "print value of x>y"
+    gdb_test "print x <= y" "$false" "print value of x<=y"
 
-gdb_test "print x >= y" "$true" "print value of x>=y"
+    gdb_test "print x > y" "$true" "print value of x>y"
 
-gdb_test "print x == y" "$false" "print value of x==y"
+    gdb_test "print x >= y" "$true" "print value of x>=y"
 
-gdb_test "print x != y" "$true" "print value of x!=y"
+    gdb_test "print x == y" "$false" "print value of x==y"
 
+    gdb_test "print x != y" "$true" "print value of x!=y"
+}
 
 # Test associativity of <, >, <=, >=, ==, !=
+with_test_prefix "basic associativity" {
 
-gdb_test_no_output "set variable x=3" "set variable x"
-gdb_test_no_output "set variable y=5" "set variable y"
-gdb_test_no_output "set variable z=2" "set variable z"
-
-gdb_test "print x < y < z" "$true" "print value of x<y<z"
-
-gdb_test "print x <= y <= z" "$true" "print value of x<=y<=z"
-
-gdb_test "print x > y > z" "$false" "print value of x>y>z"
-
-gdb_test "print x >= y >= z" "$false" "print value of x>=y>=z"
+    gdb_test_no_output "set variable x=3" "set variable x=3"
+    gdb_test_no_output "set variable y=5" "set variable y=5"
+    gdb_test_no_output "set variable z=2" "set variable z=2"
 
-gdb_test_no_output "set variable x=2" "set variable x"
-gdb_test_no_output "set variable y=2" "set variable y"
-gdb_test_no_output "set variable z=1" "set variable z"
+    gdb_test "print x < y < z" "$true" "print value of x<y<z"
 
-gdb_test "print x == y == z" "$true" "print value of x==y==z"
+    gdb_test "print x <= y <= z" "$true" "print value of x<=y<=z"
 
-gdb_test_no_output "set variable z=0" "set variable z"
+    gdb_test "print x > y > z" "$false" "print value of x>y>z"
 
-gdb_test "print x != y != z" "$false" "print value of x!=y!=z"
+    gdb_test "print x >= y >= z" "$false" "print value of x>=y>=z"
 
-# test precedence rules on pairs of relational operators
+    gdb_test_no_output "set variable x=2" "set variable x=2"
+    gdb_test_no_output "set variable y=2" "set variable y=2"
+    gdb_test_no_output "set variable z=1" "set variable z=1"
 
-gdb_test_no_output "set variable x=0" "set variable x"
-gdb_test_no_output "set variable y=2" "set variable y"
-gdb_test_no_output "set variable z=2" "set variable z"
+    gdb_test "print x == y == z" "$true" "print value of x==y==z"
 
-gdb_test "print x < y == z" "$false" "print value of x<y==z"
+    gdb_test_no_output "set variable z=0" "set variable z"
 
-# 0  2  2
-gdb_test "print x < y != z" "$true" "print value of x<y!=z"
+    gdb_test "print x != y != z" "$false" "print value of x!=y!=z"
+}
 
-gdb_test_no_output "set variable x=2" "set variable x"
-gdb_test_no_output "set variable y=3" "set variable y"
-gdb_test_no_output "set variable z=1" "set variable z"
+# Test precedence rules on pairs of relational operators.  The use of
+# with_test_prefix with keys 1, 2, 3, etc is only to ensure that the
+# test names are unique.  Each nested group of tests starts at a
+# location where we are setting a variable to a value it has had in
+# the past, which would result in a test name repeating.
+with_test_prefix "pair associativity" {
+    with_test_prefix "1" {
+	gdb_test_no_output "set variable x=0" "set variable x=0"
+	gdb_test_no_output "set variable y=2" "set variable y=2"
+	gdb_test_no_output "set variable z=2" "set variable z=2"
 
+	gdb_test "print x < y == z" "$false" "print value of x<y==z"
 
-# 2 3 1
-gdb_test "print x < y <= z" "$true" "print value of x<y<=z"
+	# 0  2  2
+	gdb_test "print x < y != z" "$true" "print value of x<y!=z"
 
-# 2 3 1
-gdb_test "print x < y >= z" "$true" "print value of x<y>=z"
+	gdb_test_no_output "set variable x=2" "set variable x=2"
+	gdb_test_no_output "set variable y=3" "set variable y=3"
+	gdb_test_no_output "set variable z=1" "set variable z=1"
 
-gdb_test_no_output "set variable z=0" " set variable z"
+	# 2 3 1
+	gdb_test "print x < y <= z" "$true" "print value of x<y<=z"
 
-# 2 3 0
-gdb_test "print x < y > z" "$true" "print value of x<y>z"
+	# 2 3 1
+	gdb_test "print x < y >= z" "$true" "print value of x<y>=z"
 
-gdb_test_no_output "set variable x=1" " set variable x"
+	gdb_test_no_output "set variable z=0" " set variable z=0"
 
-# 1 3 0
-gdb_test "print x > y >= z" "$true" "print value of x>y>=z"
+	# 2 3 0
+	gdb_test "print x < y > z" "$true" "print value of x<y>z"
 
-gdb_test_no_output "set variable z=2" " set variable z"
+	gdb_test_no_output "set variable x=1" " set variable x=1"
 
-# 1 3 2
-gdb_test "print x > y == z" "$false" "print value of x>y==z"
+	# 1 3 0
+	gdb_test "print x > y >= z" "$true" "print value of x>y>=z"
+    }
 
-gdb_test_no_output "set variable x=2" " set variable x"
-gdb_test_no_output "set variable z=0" " set variable z"
+    with_test_prefix "2" {
+	gdb_test_no_output "set variable z=2" " set variable z=2"
 
-# 2 3 0
-gdb_test "print x > y != z" "$false" "print value of x>y!=z"
+	# 1 3 2
+	gdb_test "print x > y == z" "$false" "print value of x>y==z"
 
-gdb_test_no_output "set variable x=4" "set x to 4"
+	gdb_test_no_output "set variable x=2" " set variable x=2"
+	gdb_test_no_output "set variable z=0" " set variable z=0"
 
-# 4 3 0
-gdb_test "print x > y <= z" "$false" "print value of x>y<=z"
+	# 2 3 0
+	gdb_test "print x > y != z" "$false" "print value of x>y!=z"
 
-# 4 3 0
-gdb_test "print x >= y == z" "$false" "print value of x>=y==z"
+	gdb_test_no_output "set variable x=4" "set variable x=4"
 
-gdb_test_no_output "set variable x=2" " set variable x"
+	# 4 3 0
+	gdb_test "print x > y <= z" "$false" "print value of x>y<=z"
 
-# 2 3 0
-gdb_test "print x >= y != z" "$false" "print value of x>=y!=z"
+	# 4 3 0
+	gdb_test "print x >= y == z" "$false" "print value of x>=y==z"
+    }
 
-gdb_test_no_output "set variable x=0" " set variable x"
-gdb_test_no_output "set variable z=4" " set variable z"
+    with_test_prefix "3" {
+	gdb_test_no_output "set variable x=2" " set variable x=2"
 
-# 0 3 4 
-gdb_test "print x >= y <= z" "$true" "print value of x>=y<=z"
+	# 2 3 0
+	gdb_test "print x >= y != z" "$false" "print value of x>=y!=z"
 
-# 0 3 4
-gdb_test "print x <= y == z" "$false" "print value of x<=y==z"
+	gdb_test_no_output "set variable x=0" " set variable x=0"
+	gdb_test_no_output "set variable z=4" " set variable z=4"
 
-gdb_test_no_output "set variable x=2" " set variable x"
+	# 0 3 4
+	gdb_test "print x >= y <= z" "$true" "print value of x>=y<=z"
 
-# 2 3 4
-gdb_test "print x <= y != z" "$true" "print value of x<=y!=z"
+	# 0 3 4
+	gdb_test "print x <= y == z" "$false" "print value of x<=y==z"
+    }
 
-# 2 3 4
-gdb_test "print x == y != z" "$true" "print value of x==y!=z"
+    with_test_prefix "4" {
+	gdb_test_no_output "set variable x=2" " set variable x=2"
 
+	# 2 3 4
+	gdb_test "print x <= y != z" "$true" "print value of x<=y!=z"
 
+	# 2 3 4
+	gdb_test "print x == y != z" "$true" "print value of x==y!=z"
+    }
+}
 
 # test use of parenthesis to enforce different order of evaluation
+with_test_prefix "with parenthesis" {
+    gdb_test_no_output "set variable z=0" " set variable z=0"
 
-gdb_test_no_output "set variable z=0" " set variable z"
+    # 2 3 0
+    gdb_test "print x >= (y < z)" "$true" "print value of x>=(y<z)"
 
-# 2 3 0
-gdb_test "print x >= (y < z)" "$true" "print value of x>=(y<z)"
+    # 2 3 0
+    gdb_test "print x >= (y != z)" "$true" "print value of x>=(y!=z)"
 
-# 2 3 0
-gdb_test "print x >= (y != z)" "$true" "print value of x>=(y!=z)"
+    # 2 3 0
+    gdb_test "print x == (y == z)" "$false" "print value of x==(y==z)"
 
-# 2 3 0
-gdb_test "print x == (y == z)" "$false" "print value of x==(y==z)" 
+    gdb_test_no_output "set variable x=1" " set variable x=1"
+    gdb_test_no_output "set variable z=4" " set variable z=4"
 
-gdb_test_no_output "set variable x=1" " set variable x"
-gdb_test_no_output "set variable z=4" " set variable z"
-
-# 1 3 4
-gdb_test "print (x == y) < z" "$true" "print value of (x==y)<z"
+    # 1 3 4
+    gdb_test "print (x == y) < z" "$true" "print value of (x==y)<z"
+}
 
diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp
index 8daf65b2d0d..061d706c614 100644
--- a/gdb/testsuite/gdb.base/step-over-syscall.exp
+++ b/gdb/testsuite/gdb.base/step-over-syscall.exp
@@ -27,7 +27,7 @@ if { [istarget "i\[34567\]86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
     return -1
 }
 
-proc check_pc_after_cross_syscall { syscall syscall_insn_next_addr } {
+proc_with_prefix check_pc_after_cross_syscall { syscall syscall_insn_next_addr } {
     set syscall_insn_next_addr_found [get_hexadecimal_valueof "\$pc" "0"]
 
     set test "single step over $syscall final pc"
@@ -59,7 +59,8 @@ proc setup { syscall } {
     # Delete the breakpoint on main.
     gdb_test_no_output "delete break 1"
 
-    gdb_test_no_output "set displaced-stepping off"
+    gdb_test_no_output "set displaced-stepping off" \
+	"set displaced-stepping off during test setup"
 
     gdb_test "break $syscall" "Breakpoint \[0-9\]* at .*"
 
@@ -100,11 +101,13 @@ proc setup { syscall } {
 	return { -1, -1 }
     }
 
-    set syscall_insn_addr [get_hexadecimal_valueof "\$pc" "0"]
+    set syscall_insn_addr [get_hexadecimal_valueof "\$pc" "0" \
+			       "pc before stepi"]
     if {[gdb_test "stepi" "x/i .*=>.*" "stepi $syscall insn"] != 0} {
 	return { -1, -1 }
     }
-    return [list $syscall_insn_addr [get_hexadecimal_valueof "\$pc" "0"]]
+    return [list $syscall_insn_addr [get_hexadecimal_valueof "\$pc" \
+					 "0" "pc after stepi"]]
 }
 
 proc step_over_syscall { syscall } {
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index 0e9b8d2e02c..3d4172e3648 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -82,10 +82,12 @@ proc start_structs_test { types } {
     gdb_load ${binfile}
 
     # Make certain that the output is consistent
-    gdb_test_no_output "set print sevenbit-strings"
-    gdb_test_no_output "set print address off"
-    gdb_test_no_output "set width 0"
-    gdb_test_no_output "set print elements 300"
+    with_test_prefix "types=$types" {
+	gdb_test_no_output "set print sevenbit-strings"
+	gdb_test_no_output "set print address off"
+	gdb_test_no_output "set width 0"
+	gdb_test_no_output "set print elements 300"
+    }
 
     # Advance to main
     if { ![runto_main] } then {
-- 
2.14.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] gdb/testsuite: Make test names unique in gdb.reverse tests
  2019-09-16  2:25 [PATCH 0/4] Remove some duplicate test names Andrew Burgess
                   ` (2 preceding siblings ...)
  2019-09-16  2:25 ` [PATCH 2/4] gdb/testsuite: Make test names unique in gdb.linespec tests Andrew Burgess
@ 2019-09-16  2:25 ` Andrew Burgess
  2019-09-18 20:42 ` [PATCH 0/4] Remove some duplicate test names Tom Tromey
  4 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2019-09-16  2:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

Make test names unique in the gdb.reverse tests.  On my local machine
this removed 825 duplicate test names.  It is possible that different
setups might still encounter some duplicates.

gdb/testsuite/ChangeLog:

	* gdb.reverse/break-precsave.exp: Make test names unique.
	* gdb.reverse/break-reverse.exp: Likewise.
	* gdb.reverse/finish-precsave.exp: Likewise.
	* gdb.reverse/finish-reverse.exp: Likewise.
	* gdb.reverse/machinestate-precsave.exp: Likewise.
	* gdb.reverse/machinestate.exp: Likewise.
	* gdb.reverse/readv-reverse.exp: Likewise.
	* gdb.reverse/recvmsg-reverse.exp: Likewise.
	* gdb.reverse/sigall-precsave.exp: Likewise.
	* gdb.reverse/sigall-reverse.exp: Likewise.
	* gdb.reverse/step-indirect-call-thunk.exp: Likewise.
	* gdb.reverse/watch-precsave.exp: Likewise.
	* gdb.reverse/watch-reverse.exp: Likewise.
---
 gdb/testsuite/ChangeLog                                | 16 ++++++++++++++++
 gdb/testsuite/gdb.reverse/break-precsave.exp           | 12 ++++++++----
 gdb/testsuite/gdb.reverse/break-reverse.exp            | 15 ++++++++++-----
 gdb/testsuite/gdb.reverse/finish-precsave.exp          | 18 ++++++++++++------
 gdb/testsuite/gdb.reverse/finish-reverse.exp           | 18 ++++++++++++------
 gdb/testsuite/gdb.reverse/machinestate-precsave.exp    |  6 ++++--
 gdb/testsuite/gdb.reverse/machinestate.exp             |  6 ++++--
 gdb/testsuite/gdb.reverse/readv-reverse.exp            |  8 ++++----
 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp          |  6 ++++--
 gdb/testsuite/gdb.reverse/sigall-precsave.exp          | 14 +++++++++-----
 gdb/testsuite/gdb.reverse/sigall-reverse.exp           | 14 +++++++++-----
 gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp |  4 ++--
 gdb/testsuite/gdb.reverse/watch-precsave.exp           |  6 ++++--
 gdb/testsuite/gdb.reverse/watch-reverse.exp            |  6 ++++--
 14 files changed, 102 insertions(+), 47 deletions(-)

diff --git a/gdb/testsuite/gdb.reverse/break-precsave.exp b/gdb/testsuite/gdb.reverse/break-precsave.exp
index 68ac35db53e..085526b88f6 100644
--- a/gdb/testsuite/gdb.reverse/break-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/break-precsave.exp
@@ -69,8 +69,10 @@ proc precsave_tests {} {
 	"Breakpoint $decimal at .* line $bar_location\." \
 	"set breakpoint on bar"
 
-    gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-    gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
+    gdb_continue_to_breakpoint "foo forward after restore" \
+	".*$srcfile:$foo_location.*"
+    gdb_continue_to_breakpoint "bar forward after restore" \
+	".*$srcfile:$bar_location.*"
     gdb_test_multiple "continue" "go to end of main forward" {
 	-re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $"  {
 	    pass "go to end of main forward"
@@ -96,8 +98,10 @@ proc precsave_tests {} {
 
     gdb_test_no_output "set exec-direction forward" "set forward"
 
-    gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-    gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
+    gdb_continue_to_breakpoint "foo forward again" \
+	".*$srcfile:$foo_location.*"
+    gdb_continue_to_breakpoint "bar forward again" \
+	".*$srcfile:$bar_location.*"
 
     gdb_test_multiple "continue" "end of record log" {
 	-re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.reverse/break-reverse.exp b/gdb/testsuite/gdb.reverse/break-reverse.exp
index c1242c8d4a3..602b6e6317a 100644
--- a/gdb/testsuite/gdb.reverse/break-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/break-reverse.exp
@@ -50,9 +50,12 @@ gdb_test "break $end_location" \
     "Breakpoint $decimal at .* line $end_location\." \
     "set breakpoint at end of main"
 
-gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
-gdb_continue_to_breakpoint "end" ".*$srcfile:$end_location.*"
+gdb_continue_to_breakpoint "foo forward, the first time" \
+    ".*$srcfile:$foo_location.*"
+gdb_continue_to_breakpoint "bar forward, the first time" \
+    ".*$srcfile:$bar_location.*"
+gdb_continue_to_breakpoint "end forward, the first time" \
+    ".*$srcfile:$end_location.*"
 
 gdb_test_no_output "set exec-direction reverse" "set reverse"
 
@@ -70,8 +73,10 @@ gdb_test_multiple "continue" "main backward" {
 
 gdb_test_no_output "set exec-direction forward" "set forward"
 
-gdb_continue_to_breakpoint "foo" ".*$srcfile:$foo_location.*"
-gdb_continue_to_breakpoint "bar" ".*$srcfile:$bar_location.*"
+gdb_continue_to_breakpoint "foo forward again" \
+    ".*$srcfile:$foo_location.*"
+gdb_continue_to_breakpoint "bar forward again" \
+    ".*$srcfile:$bar_location.*"
 
 gdb_test_multiple "continue" "end of record log" {
     -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.reverse/finish-precsave.exp b/gdb/testsuite/gdb.reverse/finish-precsave.exp
index d2a683751ab..a83decf7a22 100644
--- a/gdb/testsuite/gdb.reverse/finish-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/finish-precsave.exp
@@ -179,7 +179,8 @@ gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 # Test reverse finish from long long func
 
 set breakloc [gdb_get_line_number "LONG LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -191,7 +192,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from long func
 
 set breakloc [gdb_get_line_number "LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -203,7 +205,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from int func
 
 set breakloc [gdb_get_line_number "INT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "int_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "int_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from int_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -215,7 +218,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from short func
 
 set breakloc [gdb_get_line_number "SHORT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "short_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "short_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from short_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -227,7 +231,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from char func
 
 set breakloc [gdb_get_line_number "CHAR FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "char_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "char_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from char_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -239,7 +244,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from void func
 
 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "void_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from void_func"
 gdb_test_multiple "finish" "$test_msg" {
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse.exp b/gdb/testsuite/gdb.reverse/finish-reverse.exp
index 73eb2875b61..88bf4cb19b4 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse.exp
@@ -158,7 +158,8 @@ gdb_test_no_output "set exec-dir reverse" "set reverse execution"
 # Test reverse finish from long long func
 
 set breakloc [gdb_get_line_number "LONG LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -170,7 +171,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from long func
 
 set breakloc [gdb_get_line_number "LONG FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "long_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "long_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from long_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -182,7 +184,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from int func
 
 set breakloc [gdb_get_line_number "INT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "int_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "int_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from int_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -194,7 +197,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from short func
 
 set breakloc [gdb_get_line_number "SHORT FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "short_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "short_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from short_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -206,7 +210,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from char func
 
 set breakloc [gdb_get_line_number "CHAR FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "char_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "char_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from char_func"
 gdb_test_multiple "finish" "$test_msg" {
@@ -218,7 +223,8 @@ gdb_test_multiple "finish" "$test_msg" {
 # Test reverse finish from void func
 
 set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
-gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*"
+gdb_continue_to_breakpoint "void_func backward" \
+    ".*$srcfile:$breakloc.*"
 
 set test_msg "reverse finish from void_func"
 gdb_test_multiple "finish" "$test_msg" {
diff --git a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
index a0df7c1d3f0..73e02a939ff 100644
--- a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
@@ -167,7 +167,8 @@ gdb_test "reverse-continue" ".*$srcfile:$breakloc.*" "reverse to $breakloc"
 
 gdb_test "print a"      ".* = 0$newline"  "register var reverse-breakpoint"
 gdb_test "step"         ".* register post-change .*" ""
-gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
+gdb_test "print a"      ".* = 1$newline"  \
+    "register var step post-change, first time"
 gdb_test "reverse-step" ".*$newline$breakloc.*" ""
 gdb_test "print a"      ".* = 0$newline"  "register var reverse step-to"
 
@@ -191,7 +192,8 @@ gdb_test "reverse-step" ".*hide.*" ""
 gdb_test "step"         ".*$newline$breakloc.*" ""
 gdb_test "print a"      ".* = 0$newline"  "register var forward step-to"
 gdb_test "step"         ".* register post-change .*" ""
-gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
+gdb_test "print a"      ".* = 1$newline" \
+    "register var step post-change, second time"
 
 # Auto variable, forward
 
diff --git a/gdb/testsuite/gdb.reverse/machinestate.exp b/gdb/testsuite/gdb.reverse/machinestate.exp
index ed65db14406..623498f07ac 100644
--- a/gdb/testsuite/gdb.reverse/machinestate.exp
+++ b/gdb/testsuite/gdb.reverse/machinestate.exp
@@ -142,7 +142,8 @@ gdb_test "print a"      ".* = 0$newline"  "register var reverse-breakpoint"
 gdb_test "step"         ".* register post-change .*" ""
 gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
 gdb_test "reverse-step" ".*$newline$breakloc.*" ""
-gdb_test "print a"      ".* = 0$newline"  "register var reverse step-to"
+gdb_test "print a"      ".* = 0$newline"  \
+    "register var reverse step-to, first time"
 
 # Proceed to beginning of main
 
@@ -164,7 +165,8 @@ gdb_test "reverse-step" ".*hide.*" ""
 gdb_test "step"         ".*$newline$breakloc.*" ""
 gdb_test "print a"      ".* = 0$newline"  "register var forward step-to"
 gdb_test "step"         ".* register post-change .*" ""
-gdb_test "print a"      ".* = 1$newline"  "register var step post-change"
+gdb_test "print a"      ".* = 1$newline"  \
+    "register var step post-change, second time"
 
 # Auto variable, forward
 
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index 19ad423a412..2f16c5cad8c 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -52,7 +52,7 @@ gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
 # will be remembered.  If not, new contents ("NUXI") will be
 # used, and the test will fail.
 
-gdb_test "print (int)buf\[0]" ".* = 0" "check readv record"
-gdb_test "print (int)buf\[1]" ".* = 0" "check readv record"
-gdb_test "print (int)buf\[2]" ".* = 0" "check readv record"
-gdb_test "print (int)buf\[3]" ".* = 0" "check readv record"
+for { set i 0 } { $i < 4 } { incr i } {
+    gdb_test "print (int)buf\[$i]" ".* = 0" \
+	"check readv record for buf\[$i\]"
+}
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
index 724927fe6c2..9eea3e75ede 100644
--- a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -55,11 +55,13 @@ gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
 gdb_test "print rdata" ".* = \"xxxx\"" "check recvmsg record - rdata"
 
 # rmsg.msg_flags should be zeros, not MSG_TRUNC | MSG_CTRUNC
-gdb_test "print rmsg.msg_flags" ".* = 0" "check recvmsg record - rmsg"
+gdb_test "print rmsg.msg_flags" ".* = 0" \
+    "check recvmsg record - rmsg.msg_flags"
 
 # rmsg.msg_controllen should be sizeof rc, not actual size of control data
 # (7 bytes less)
-gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" "check recvmsg record - rmsg"
+gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" \
+    "check recvmsg record - rmsg.msg_controllen"
 
 # rc should be zeros, not received cmsg
 gdb_test "print ((struct cmsghdr *)rc)->cmsg_len" ".* = 0" "check recvmsg record - cmsg"
diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
index 79a1e7282b6..371eecd7110 100644
--- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
@@ -117,7 +117,7 @@ proc test_one_sig_reverse {prevsig} {
 	-re "Program received signal SIG$prevsig.*$gdb_prompt " {
 	    pass "reverse to signal event, $prevsig"
 
-	    set nested_testmsg "reverse signal delivered"
+	    set nested_testmsg "reverse signal $prevsig delivered"
 	    gdb_test_multiple "frame" $nested_testmsg {
 		-re ".*handle_$prevsig.*$gdb_prompt " {
 		    fail "$nested_testmsg (wrong location)"
@@ -289,8 +289,10 @@ set sig_supported 1
 set thissig "ABRT"
 
 # test signal handling
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-1" {
+    foreach sig [lrange $signals 1 end] {
+	test_one_sig $sig
+    }
 }
 
 # The last signal (SIGTERM) gets handled slightly differently because
@@ -313,6 +315,8 @@ foreach sig [lreverse $signals] {
 set sig_supported 1
 set thissig "ABRT"
 
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-2" {
+    foreach sig [lrange $signals 1 end] {
+	test_one_sig $sig
+    }
 }
diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
index c734fe8e17a..651e14d9eed 100644
--- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
@@ -116,7 +116,7 @@ proc test_one_sig_reverse {prevsig} {
 	-re "Program received signal SIG$prevsig.*$gdb_prompt " {
 	    pass "reverse to signal event, $prevsig"
 
-	    set nested_testmsg "reverse signal delivered"
+	    set nested_testmsg "reverse signal $prevsig delivered"
 	    gdb_test_multiple "frame" $nested_testmsg {
 		-re ".*handle_$prevsig.*$gdb_prompt " {
 		    fail "$nested_testmsg (wrong location)"
@@ -237,8 +237,10 @@ set sig_supported 1
 set thissig "ABRT"
 
 # test signal handling
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-1" {
+    foreach sig [lrange $signals 1 end] {
+	test_one_sig $sig
+    }
 }
 
 # The last signal (SIGTERM) gets handled slightly differently because
@@ -265,6 +267,8 @@ foreach sig [lreverse $signals] {
 set sig_supported 1
 set thissig "ABRT"
 
-foreach sig [lrange $signals 1 end] {
-    test_one_sig $sig
+with_test_prefix "sig-test-2" {
+    foreach sig [lrange $signals 1 end] {
+	test_one_sig $sig
+    }
 }
diff --git a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
index 2c6cbe95318..aa1a4f3561e 100644
--- a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
+++ b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
@@ -72,12 +72,12 @@ gdb_test "reverse-step" "apply\.3.*" "reverse-step into apply"
 gdb_test "reverse-step" "inc\.3.*" "reverse-step into inc"
 gdb_test "reverse-step" "inc\.2.*" "reverse-step inside inc"
 gdb_test "reverse-step" "apply\.2.*" \
-    "reverse-step through call thunk into apply"
+    "reverse-step through call thunk into apply, first time"
 gdb_test "reverse-step" "main\.2.*" "reverse-step into main"
 gdb_test "step" "apply\.2.*" "step into apply"
 gdb_test "step" "inc\.2.*" "step through call thunk into inc"
 gdb_test "reverse-step" "apply\.2.*" \
-    "reverse-step through call thunk into apply"
+    "reverse-step through call thunk into apply, second time"
 gdb_test "next" "apply\.3.*" "step through thunks and over inc"
 gdb_test "reverse-next" "apply\.2.*" \
     "reverse-step through thunks and over inc"
diff --git a/gdb/testsuite/gdb.reverse/watch-precsave.exp b/gdb/testsuite/gdb.reverse/watch-precsave.exp
index 6ba381fb49e..f49a8df76f8 100644
--- a/gdb/testsuite/gdb.reverse/watch-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/watch-precsave.exp
@@ -108,7 +108,8 @@ gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, first time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
@@ -183,7 +184,8 @@ gdb_test "continue" "marker2 .*" "replay forward to marker2"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, second time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.exp b/gdb/testsuite/gdb.reverse/watch-reverse.exp
index 4cc04e81e9e..9e866dfdd53 100644
--- a/gdb/testsuite/gdb.reverse/watch-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/watch-reverse.exp
@@ -89,7 +89,8 @@ gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, first time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
@@ -164,7 +165,8 @@ gdb_test "continue" "marker2 .*" "replay forward to marker2"
 ###
 ###
 
-gdb_test_no_output "set exec-direction reverse" "set reverse"
+gdb_test_no_output "set exec-direction reverse" \
+    "set reverse, second time"
 
 # Reverse until the previous change, from 4 to 3
 # Note that this one is outside the loop
-- 
2.14.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/4] gdb/testsuite: Reduce test name duplication in gdb.python tests
  2019-09-16  2:25 [PATCH 0/4] Remove some duplicate test names Andrew Burgess
@ 2019-09-16  2:25 ` Andrew Burgess
  2019-09-16  2:25 ` [PATCH 3/4] gdb/testsuite: Reduce test name duplication in gdb.base tests Andrew Burgess
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2019-09-16  2:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

This commit removes some, but not all, of the test name duplication
within the gdb.python tests.  On my local machine this takes the
number of duplicate test names in this set of tests from 174 to 85.
It is possible that different setups might encounter more duplicate
tests.

gdb/testsuite/ChangeLog:

	* gdb.python/py-parameter.exp: Make test names unique.
	* gdb.python/py-template.exp: Likewise.
	* gdb.python/py-value.exp: Likewise.
---
 gdb/testsuite/ChangeLog                   |   6 +
 gdb/testsuite/gdb.python/py-parameter.exp | 317 ++++++++++++++++++------------
 gdb/testsuite/gdb.python/py-template.exp  |   8 +-
 gdb/testsuite/gdb.python/py-value.exp     |  58 +++---
 4 files changed, 231 insertions(+), 158 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp
index a199f72dd14..b2f78777338 100644
--- a/gdb/testsuite/gdb.python/py-parameter.exp
+++ b/gdb/testsuite/gdb.python/py-parameter.exp
@@ -38,147 +38,204 @@ if { [is_remote host] } {
 gdb_test "python print (gdb.parameter ('directories'))" $directories
 
 # Test a simple boolean parameter.
-gdb_py_test_multiple "Simple gdb booleanparameter" \
-   "python" "" \
-   "class TestParam (gdb.Parameter):" "" \
-   "   \"\"\"When enabled, test param does something useful. When disabled, does nothing.\"\"\"" "" \
-   "   show_doc = \"Show the state of the boolean test-param\"" ""\
-   "   set_doc = \"Set the state of the boolean test-param\"" "" \
-   "   def get_show_string (self, pvalue):" ""\
-   "      return \"The state of the Test Parameter is \" + pvalue" ""\
-   "   def get_set_string (self):" ""\
-   "      val = \"on\"" ""\
-   "      if (self.value == False):" ""\
-   "         val = \"off\"" ""\
-   "      return \"Test Parameter has been set to \" + val" ""\
-   "   def __init__ (self, name):" "" \
-   "      super (TestParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
-   "      self.value = True" "" \
-   "test_param = TestParam ('print test-param')" ""\
-   "end"
-
-gdb_test "python print (test_param.value)" "True" "test parameter value"
-gdb_test "show print test-param" "The state of the Test Parameter is on.*" "show parameter on"
-gdb_test "set print test-param off" "Test Parameter has been set to off" "turn off parameter"
-gdb_test "show print test-param" "The state of the Test Parameter is off.*" "show parameter off"
-gdb_test "python print (test_param.value)" "False" "test parameter value"
-gdb_test "help show print test-param" "Show the state of the boolean test-param.*" "test show help"
-gdb_test "help set print test-param" "Set the state of the boolean test-param.*" "test set help"
-gdb_test "help set print" "set print test-param -- Set the state of the boolean test-param.*" "test general help"
+with_test_prefix "boolean parameter" {
+    gdb_py_test_multiple "Simple gdb booleanparameter" \
+	"python" "" \
+	"class TestParam (gdb.Parameter):" "" \
+	"   \"\"\"When enabled, test param does something useful. When disabled, does nothing.\"\"\"" "" \
+	"   show_doc = \"Show the state of the boolean test-param\"" ""\
+	"   set_doc = \"Set the state of the boolean test-param\"" "" \
+	"   def get_show_string (self, pvalue):" ""\
+	"      return \"The state of the Test Parameter is \" + pvalue" ""\
+	"   def get_set_string (self):" ""\
+	"      val = \"on\"" ""\
+	"      if (self.value == False):" ""\
+	"         val = \"off\"" ""\
+	"      return \"Test Parameter has been set to \" + val" ""\
+	"   def __init__ (self, name):" "" \
+	"      super (TestParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
+	"      self.value = True" "" \
+	"test_param = TestParam ('print test-param')" ""\
+	"end"
 
+    gdb_test "python print (test_param.value)" "True" \
+	"test boolean parameter value is True"
+    gdb_test "show print test-param" \
+	"The state of the Test Parameter is on.*" "show parameter on"
+    gdb_test "set print test-param off" \
+	"Test Parameter has been set to off" "turn off parameter"
+    gdb_test "show print test-param" \
+	"The state of the Test Parameter is off.*" "show parameter off"
+    gdb_test "python print (test_param.value)" "False" \
+	"test boolean parameter value is False"
+    gdb_test "help show print test-param" \
+	"Show the state of the boolean test-param.*" "test show help"
+    gdb_test "help set print test-param" \
+	"Set the state of the boolean test-param.*" "test set help"
+    gdb_test "help set print" \
+	"set print test-param -- Set the state of the boolean test-param.*" \
+	"test general help"
+}
 
 # Test an enum parameter.
-gdb_py_test_multiple "enum gdb parameter" \
-   "python" "" \
-   "class TestEnumParam (gdb.Parameter):" "" \
-   "   \"\"\"When set, test param does something useful. When disabled, does nothing.\"\"\"" "" \
-   "   show_doc = \"Show the state of the enum\"" ""\
-   "   set_doc = \"Set the state of the enum\"" "" \
-   "   def get_show_string (self, pvalue):" ""\
-   "      return \"The state of the enum is \" + pvalue" ""\
-   "   def get_set_string (self):" ""\
-   "      return \"The state of the enum has been set to \" + self.value" ""\
-   "   def __init__ (self, name):" "" \
-   "      super (TestEnumParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_ENUM, \[\"one\", \"two\"\])" "" \
-   "      self.value = \"one\"" "" \
-   "test_enum_param = TestEnumParam ('print test-enum-param')" ""\
-   "end"
-
-gdb_test "python print (test_enum_param.value)" "one" "test enum parameter value"
-gdb_test "show print test-enum-param" "The state of the enum is one.*" "show parameter is initial value"
-gdb_test "set print test-enum-param two" "The state of the enum has been set to two" "set enum to two"
-gdb_test "show print test-enum-param" "The state of the enum is two.*" "show parameter is new value"
-gdb_test "python print (test_enum_param.value)" "two" "test enum parameter value"
-gdb_test "set print test-enum-param three" "Undefined item: \"three\".*" "set invalid enum parameter"
+with_test_prefix "enum parameter" {
+    gdb_py_test_multiple "enum gdb parameter" \
+	"python" "" \
+	"class TestEnumParam (gdb.Parameter):" "" \
+	"   \"\"\"When set, test param does something useful. When disabled, does nothing.\"\"\"" "" \
+	"   show_doc = \"Show the state of the enum\"" ""\
+	"   set_doc = \"Set the state of the enum\"" "" \
+	"   def get_show_string (self, pvalue):" ""\
+	"      return \"The state of the enum is \" + pvalue" ""\
+	"   def get_set_string (self):" ""\
+	"      return \"The state of the enum has been set to \" + self.value" ""\
+	"   def __init__ (self, name):" "" \
+	"      super (TestEnumParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_ENUM, \[\"one\", \"two\"\])" "" \
+	"      self.value = \"one\"" "" \
+	"test_enum_param = TestEnumParam ('print test-enum-param')" ""\
+	"end"
+
+    gdb_test "python print (test_enum_param.value)" "one" \
+	"test enum parameter value is one"
+    gdb_test "show print test-enum-param" \
+	"The state of the enum is one.*" \
+	"show parameter is initial value"
+    gdb_test "set print test-enum-param two" \
+	"The state of the enum has been set to two" "set enum to two"
+    gdb_test "show print test-enum-param" \
+	"The state of the enum is two.*" "show parameter is new value"
+    gdb_test "python print (test_enum_param.value)" "two" \
+	"test enum parameter value is two"
+    gdb_test "set print test-enum-param three" \
+	"Undefined item: \"three\".*" "set invalid enum parameter"
+}
 
 # Test a file parameter.
-gdb_py_test_multiple "file gdb parameter" \
-   "python" "" \
-   "class TestFileParam (gdb.Parameter):" "" \
-   "   \"\"\"When set, test param does something useful. When disabled, does nothing.\"\"\"" "" \
-   "   show_doc = \"Show the name of the file\"" ""\
-   "   set_doc = \"Set the name of the file\"" "" \
-   "   def get_show_string (self, pvalue):" ""\
-   "      return \"The name of the file is \" + pvalue" ""\
-   "   def get_set_string (self):" ""\
-   "      return \"The name of the file has been changed to \" + self.value" ""\
-   "   def __init__ (self, name):" "" \
-   "      super (TestFileParam, self).__init__ (name, gdb.COMMAND_FILES, gdb.PARAM_FILENAME)" "" \
-   "      self.value = \"foo.txt\"" "" \
-   "test_file_param = TestFileParam ('test-file-param')" ""\
-   "end"
-
-gdb_test "python print (test_file_param.value)" "foo.txt" "test file parameter value"
-gdb_test "show test-file-param" "The name of the file is foo.txt.*" "show initial file value"
-gdb_test "set test-file-param bar.txt" "The name of the file has been changed to bar.txt" "set new file parameter" 1
-gdb_test "show test-file-param" "The name of the file is bar.txt.*" "show new file value"
-gdb_test "python print (test_file_param.value)" "bar.txt" "test new file parameter value"
-gdb_test "set test-file-param" "Argument required.*" 
+with_test_prefix "file parameter" {
+    gdb_py_test_multiple "file gdb parameter" \
+	"python" "" \
+	"class TestFileParam (gdb.Parameter):" "" \
+	"   \"\"\"When set, test param does something useful. When disabled, does nothing.\"\"\"" "" \
+	"   show_doc = \"Show the name of the file\"" ""\
+	"   set_doc = \"Set the name of the file\"" "" \
+	"   def get_show_string (self, pvalue):" ""\
+	"      return \"The name of the file is \" + pvalue" ""\
+	"   def get_set_string (self):" ""\
+	"      return \"The name of the file has been changed to \" + self.value" ""\
+	"   def __init__ (self, name):" "" \
+	"      super (TestFileParam, self).__init__ (name, gdb.COMMAND_FILES, gdb.PARAM_FILENAME)" "" \
+	"      self.value = \"foo.txt\"" "" \
+	"test_file_param = TestFileParam ('test-file-param')" ""\
+	"end"
+
+    gdb_test "python print (test_file_param.value)" "foo.txt" \
+	"test file parameter value"
+    gdb_test "show test-file-param" \
+	"The name of the file is foo.txt.*" "show initial file value"
+    gdb_test "set test-file-param bar.txt" \
+	"The name of the file has been changed to bar.txt" \
+	"set new file parameter" 1
+    gdb_test "show test-file-param" \
+	"The name of the file is bar.txt.*" "show new file value"
+    gdb_test "python print (test_file_param.value)" \
+	"bar.txt" "test new file parameter value"
+    gdb_test "set test-file-param" "Argument required.*"
+}
 
 # Test a parameter that is not documented.
-gdb_py_test_multiple "Simple gdb booleanparameter" \
-   "python" "" \
-   "class TestUndocParam (gdb.Parameter):" "" \
-   "   def get_show_string (self, pvalue):" ""\
-   "      return \"The state of the Test Parameter is \" + pvalue" ""\
-   "   def get_set_string (self):" ""\
-   "      val = \"on\"" ""\
-   "      if (self.value == False):" ""\
-   "         val = \"off\"" ""\
-   "      return \"Test Parameter has been set to \" + val" ""\
-   "   def __init__ (self, name):" "" \
-   "      super (TestUndocParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
-   "      self.value = True" "" \
-   "test_undoc_param = TestUndocParam ('print test-undoc-param')" ""\
-   "end"
-
-gdb_test "show print test-undoc-param" "The state of the Test Parameter is on.*" "show parameter on"
-gdb_test "set print test-undoc-param off" "Test Parameter has been set to off" "turn off parameter"
-gdb_test "show print test-undoc-param" "The state of the Test Parameter is off.*" "show parameter off"
-gdb_test "python print (test_undoc_param.value)" "False" "test parameter value"
-gdb_test "help show print test-undoc-param" "This command is not documented.*" "test show help"
-gdb_test "help set print test-undoc-param" "This command is not documented.*" "test set help"
-gdb_test "help set print" "set print test-undoc-param -- This command is not documented.*" "test general help"
+with_test_prefix "undocumented parameter" {
+    gdb_py_test_multiple "Simple gdb booleanparameter" \
+	"python" "" \
+	"class TestUndocParam (gdb.Parameter):" "" \
+	"   def get_show_string (self, pvalue):" ""\
+	"      return \"The state of the Test Parameter is \" + pvalue" ""\
+	"   def get_set_string (self):" ""\
+	"      val = \"on\"" ""\
+	"      if (self.value == False):" ""\
+	"         val = \"off\"" ""\
+	"      return \"Test Parameter has been set to \" + val" ""\
+	"   def __init__ (self, name):" "" \
+	"      super (TestUndocParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
+	"      self.value = True" "" \
+	"test_undoc_param = TestUndocParam ('print test-undoc-param')" ""\
+	"end"
+
+    gdb_test "show print test-undoc-param" \
+	"The state of the Test Parameter is on.*" "show parameter on"
+    gdb_test "set print test-undoc-param off" \
+	"Test Parameter has been set to off" "turn off parameter"
+    gdb_test "show print test-undoc-param" \
+	"The state of the Test Parameter is off.*" "show parameter off"
+    gdb_test "python print (test_undoc_param.value)" \
+	"False" "test undocumented parameter value is False"
+    gdb_test "help show print test-undoc-param" \
+	"This command is not documented.*" "test show help"
+    gdb_test "help set print test-undoc-param" \
+	"This command is not documented.*" "test set help"
+    gdb_test "help set print" \
+	"set print test-undoc-param -- This command is not documented.*" \
+	"test general help"
+}
 
 # Test a parameter that is not documented in any way..
-gdb_py_test_multiple "Simple gdb booleanparameter" \
-   "python" "" \
-   "class TestNodocParam (gdb.Parameter):" "" \
-   "   def __init__ (self, name):" "" \
-   "      super (TestNodocParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
-   "      self.value = True" "" \
-   "test_nodoc_param = TestNodocParam ('print test-nodoc-param')" ""\
-   "end"
-
-gdb_test "show print test-nodoc-param" "This command is not documented.*" "show parameter on"
-gdb_test_no_output "set print test-nodoc-param off" "turn off parameter"
-gdb_test "show print test-nodoc-param" "This command is not documented.*.*" "show parameter off"
-gdb_test "python print (test_nodoc_param.value)" "False" "test parameter value"
-gdb_test "help show print test-nodoc-param" "This command is not documented.*" "test show help"
-gdb_test "help set print test-nodoc-param" "This command is not documented.*" "test set help"
-gdb_test "help set print" "set print test-nodoc-param -- This command is not documented.*" "test general help"
+with_test_prefix "really undocumented parameter" {
+    gdb_py_test_multiple "Simple gdb booleanparameter" \
+	"python" "" \
+	"class TestNodocParam (gdb.Parameter):" "" \
+	"   def __init__ (self, name):" "" \
+	"      super (TestNodocParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
+	"      self.value = True" "" \
+	"test_nodoc_param = TestNodocParam ('print test-nodoc-param')" ""\
+	"end"
+
+    gdb_test "show print test-nodoc-param" \
+	"This command is not documented.*" "show parameter on"
+    gdb_test_no_output "set print test-nodoc-param off" \
+	"turn off parameter"
+    gdb_test "show print test-nodoc-param" \
+	"This command is not documented.*.*" "show parameter off"
+    gdb_test "python print (test_nodoc_param.value)" \
+	"False" "test really undocumented parameter value is False"
+    gdb_test "help show print test-nodoc-param" \
+	"This command is not documented.*" "test show help"
+    gdb_test "help set print test-nodoc-param" \
+	"This command is not documented.*" "test set help"
+    gdb_test "help set print" \
+	"set print test-nodoc-param -- This command is not documented.*" \
+	"test general help"
+}
 
 # Test deprecated API. Do not use in your own implementations.
-gdb_py_test_multiple "Simple gdb booleanparameter" \
-   "python" "" \
-   "class TestParam (gdb.Parameter):" "" \
-   "   \"\"\"When enabled, test param does something useful. When disabled, does nothing.\"\"\"" "" \
-   "   show_doc = \"State of the Test Parameter\"" ""\
-   "   set_doc = \"Set the state of the Test Parameter\"" "" \
-   "   def __init__ (self, name):" "" \
-   "      super (TestParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
-   "      self.value = True" "" \
-   "test_param = TestParam ('print test-param')" ""\
-   "end"
-
-gdb_test "python print (test_param.value)" "True" "test parameter value"
-gdb_test "show print test-param" "State of the Test Parameter on.*" "show parameter on"
-gdb_test_no_output "set print test-param off" "turn off parameter"
-gdb_test "show print test-param" "State of the Test Parameter off.*" "show parameter off"
-gdb_test "python print (test_param.value)" "False" "test parameter value"
-gdb_test "help show print test-param" "State of the Test Parameter.*" "test show help"
-gdb_test "help set print test-param" "Set the state of the Test Parameter.*" "test set help"
-gdb_test "help set print" "set print test-param -- Set the state of the Test Parameter.*" "test general help"
+with_test_prefix "deprecated API parameter" {
+    gdb_py_test_multiple "Simple gdb booleanparameter" \
+	"python" "" \
+	"class TestParam (gdb.Parameter):" "" \
+	"   \"\"\"When enabled, test param does something useful. When disabled, does nothing.\"\"\"" "" \
+	"   show_doc = \"State of the Test Parameter\"" ""\
+	"   set_doc = \"Set the state of the Test Parameter\"" "" \
+	"   def __init__ (self, name):" "" \
+	"      super (TestParam, self).__init__ (name, gdb.COMMAND_DATA, gdb.PARAM_BOOLEAN)" "" \
+	"      self.value = True" "" \
+	"test_param = TestParam ('print test-param')" ""\
+	"end"
+
+    gdb_test "python print (test_param.value)" "True" \
+	"test deprecated API parameter value is True"
+    gdb_test "show print test-param" \
+	"State of the Test Parameter on.*" "show parameter on"
+    gdb_test_no_output "set print test-param off" "turn off parameter"
+    gdb_test "show print test-param" \
+	"State of the Test Parameter off.*" "show parameter off"
+    gdb_test "python print (test_param.value)" "False" \
+	"test deprecated API parameter value is False"
+    gdb_test "help show print test-param" \
+	"State of the Test Parameter.*" "test show help"
+    gdb_test "help set print test-param" \
+	"Set the state of the Test Parameter.*" "test set help"
+    gdb_test "help set print" \
+	"set print test-param -- Set the state of the Test Parameter.*" \
+	"test general help"
+}
 
 foreach kind {PARAM_ZUINTEGER PARAM_ZUINTEGER_UNLIMITED} {
     gdb_py_test_multiple "Simple gdb $kind" \
diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb.python/py-template.exp
index 82b9f35fbaa..d0bded49d92 100644
--- a/gdb/testsuite/gdb.python/py-template.exp
+++ b/gdb/testsuite/gdb.python/py-template.exp
@@ -48,8 +48,10 @@ proc test_template_arg {exefile type} {
 	return
     }
     # There is no executable code in main(), so we are where we want to be
-    gdb_test "print (foo)" ".*"
-    gdb_test_no_output "python foo = gdb.history(0)"
+    gdb_test "print (foo)" ".*" \
+	"print (foo) in template test of $type"
+    gdb_test_no_output "python foo = gdb.history(0)" \
+	"fetch foo from gdb.history(0) in template test of $type"
 
     # Replace '*' with '\*' in regex.
     regsub -all {\*} $type {\*} t
@@ -57,7 +59,7 @@ proc test_template_arg {exefile type} {
 
     gdb_test "python print(foo.type.template_argument(-1))" \
 	"Template argument number must be non-negative\r\nError while executing Python code." \
-	"negative template argument number"
+	"negative template argument number in template test of $type"
 }
 
 test_template_arg "${binfile}-ci" "const int"
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index 51edfa30958..44939800b9f 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -189,9 +189,9 @@ proc test_value_boolean {} {
 
   gdb_test "py test_bool (gdb.Value (0))" "nay" "check evaluation of false integer value in expression"
 
-  gdb_test "py test_bool (gdb.Value (5.2))" "yay" "check evaluation of true integer value in expression"
+  gdb_test "py test_bool (gdb.Value (5.2))" "yay" "check evaluation of true float value in expression"
 
-  gdb_test "py test_bool (gdb.Value (0.0))" "nay" "check evaluation of false integer value in expression"
+  gdb_test "py test_bool (gdb.Value (0.0))" "nay" "check evaluation of false float value in expression"
 }
 
 proc test_value_compare {} {
@@ -232,13 +232,12 @@ proc test_value_in_inferior {} {
   global gdb_py_is_py3k
 
   gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"]
-
   gdb_continue_to_breakpoint "break to inspect struct and union"
 
   # Just get inferior variable s in the value history, available to python.
   gdb_test "print s" " = {a = 3, b = 5}" ""
 
-  gdb_py_test_silent_cmd "python s = gdb.history (0)" "get value from history" 1
+  gdb_py_test_silent_cmd "python s = gdb.history (0)" "get value s from history" 1
 
   gdb_test "python print ('result = ' + str(s\['a'\]))" " = 3" "access element inside struct using 8-bit string name"
   if { $gdb_py_is_py3k == 0 } {
@@ -290,17 +289,23 @@ proc test_value_in_inferior {} {
   } else {
     gdb_test "python inval = gdb.parse_and_eval('*(int*)0')"
     gdb_test "python print (inval.is_lazy)" "True"
-    gdb_test "python inval2 = inval+1" "gdb.MemoryError: Cannot access memory at address 0x0.*" $test
-    gdb_test "python inval.fetch_lazy ()" "gdb.MemoryError: Cannot access memory at address 0x0.*" $test
+    gdb_test "python inval2 = inval+1" \
+	"gdb.MemoryError: Cannot access memory at address 0x0.*" \
+	"$test, first test"
+    gdb_test "python inval.fetch_lazy ()" \
+	"gdb.MemoryError: Cannot access memory at address 0x0.*" \
+	"$test, second test"
   }
   set argc_value [get_integer_valueof "argc" 0]
   gdb_test "python argc_lazy = gdb.parse_and_eval('argc')"
   gdb_test "python argc_notlazy = gdb.parse_and_eval('argc')"
   gdb_test "python argc_notlazy.fetch_lazy()"
-  gdb_test "python print (argc_lazy.is_lazy)" "True"
+  gdb_test "python print (argc_lazy.is_lazy)" "True" \
+      "python print (argc_lazy.is_lazy) the first time"
   gdb_test "python print (argc_notlazy.is_lazy)" "False"
   gdb_test "print argc" " = $argc_value" "sanity check argc"
-  gdb_test "python print (argc_lazy.is_lazy)" "\r\nTrue"
+  gdb_test "python print (argc_lazy.is_lazy)" "\r\nTrue" \
+      "python print (argc_lazy.is_lazy) the second time"
   gdb_test_no_output "set argc=[expr $argc_value + 1]" "change argc"
   gdb_test "python print (argc_notlazy)" "\r\n$argc_value"
   gdb_test "python print (argc_lazy)" "\r\n[expr $argc_value + 1]"
@@ -308,7 +313,7 @@ proc test_value_in_inferior {} {
 
   # Test string fetches,  both partial and whole.
   gdb_test "print st" "\"divide et impera\""
-  gdb_py_test_silent_cmd "python st = gdb.history (0)" "get value from history" 1
+  gdb_py_test_silent_cmd "python st = gdb.history (0)" "get value st from history" 1
   gdb_test "python print (st.string ())"  "divide et impera"  "Test string with no length"
   gdb_test "python print (st.string (length = -1))" "divide et impera" "test string (length = -1) is all of the string"
   gdb_test "python print (st.string (length = 6))" "divide"
@@ -325,7 +330,7 @@ proc test_value_in_inferior {} {
 
   # Fetch a string that has embedded nulls.
   gdb_test "print nullst" "\"divide\\\\000et\\\\000impera\".*"
-  gdb_py_test_silent_cmd "python nullst = gdb.history (0)" "get value from history" 1
+  gdb_py_test_silent_cmd "python nullst = gdb.history (0)" "get value nullst from history" 1
   gdb_test "python print (nullst.string ())" "divide" "test string to first null"
   # Python cannot print strings that contain the null (\0) character.
   # For the purposes of this test, use repr()
@@ -350,26 +355,28 @@ proc test_inferior_function_call {} {
 
     # Correct inferior call without arguments.
     gdb_test "p/x fp1" " = $hex.*"
-    gdb_py_test_silent_cmd "python fp1 = gdb.history (0)" "get value from history" 1
+    gdb_py_test_silent_cmd "python fp1 = gdb.history (0)" "get value fp1 from history" 1
     gdb_test "python fp1 = fp1.dereference()" ""
     gdb_test "python result = fp1()" ""
     gdb_test "python print (result)" "void"
 
     # Correct inferior call with arguments.
-    gdb_test "p/x fp2" " = $hex.*"
-    gdb_py_test_silent_cmd "python fp2 = gdb.history (0)" "get value from history" 1
+    gdb_test "p/x fp2" " = $hex.*" \
+	"print fp2 to place it into history"
+    gdb_py_test_silent_cmd "python fp2 = gdb.history (0)" "get value fp2 from history" 1
     gdb_test "python fp2 = fp2.dereference()" ""
     gdb_test "python result2 = fp2(10,20)" ""
     gdb_test "python print (result2)" "30"
 
     # Incorrect to call an int value.
     gdb_test "p i" " = $decimal.*"
-    gdb_py_test_silent_cmd "python i = gdb.history (0)" "get value from history" 1
+    gdb_py_test_silent_cmd "python i = gdb.history (0)" "get value i from history" 1
     gdb_test "python result3 = i()" ".*Value is not callable.*"
 
     # Incorrect number of arguments.
-    gdb_test "p/x fp2" " = $hex.*"
-    gdb_py_test_silent_cmd "python fp3 = gdb.history (0)" "get value from history" 1
+    gdb_test "p/x fp2" " = $hex.*" \
+	"print fp2 again to place it into history"
+    gdb_py_test_silent_cmd "python fp3 = gdb.history (0)" "get value fp3 from history" 1
     gdb_test "python fp3 = fp3.dereference()" ""
     gdb_test "python result2 = fp3(10)" ".*Too few arguments in function call.*"
 }
@@ -451,12 +458,13 @@ proc test_subscript_regression {exefile lang} {
  }
 
  gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"]
- gdb_continue_to_breakpoint "break to inspect struct and union"
+ gdb_continue_to_breakpoint \
+     "break to inspect struct and union for subscript regression test"
 
  gdb_py_test_silent_cmd "python intv = gdb.Value(1)" \
-     "Create a value for subscript test" 1
+     "Create value intv for subscript test" 1
  gdb_py_test_silent_cmd "python stringv = gdb.Value(\"foo\")" \
-     "Create a value for subscript test" 1
+     "Create value stringv for subscript test" 1
 
  # Try to access an int with a subscript.  This should fail.
  gdb_test "python print (intv)" "1" "baseline print of an int Python value"
@@ -469,19 +477,19 @@ proc test_subscript_regression {exefile lang} {
 
  # Try to access an int array via a pointer with a subscript.  This should pass.
  gdb_py_test_silent_cmd "print p" "Build pointer to array" 1
- gdb_py_test_silent_cmd "python pointer = gdb.history(0)" "" 1
+ gdb_py_test_silent_cmd "python pointer = gdb.history(0)" "fetch pointer" 0
  gdb_test "python print (pointer\[0\])" "1" "access array via pointer with int subscript"
  gdb_test "python print (pointer\[intv\])" "2" "access array via pointer with value subscript"
 
  # Try to access a single dimension array with a subscript to the
  # result.  This should fail.
  gdb_test "python print (pointer\[intv\]\[0\])" "gdb.error: Cannot subscript requested type.*" \
-     "Attempt to access an integer with a subscript"
+     "Attempt to access a single dimension array with a two subscripts"
 
  # Lastly, test subscript access to an array with multiple
  # dimensions.  This should pass.
  gdb_py_test_silent_cmd "print {\"fu \",\"foo\",\"bar\"}" "Build array" 1
- gdb_py_test_silent_cmd "python marray = gdb.history(0)" "" 1
+ gdb_py_test_silent_cmd "python marray = gdb.history(0)" "fetch marray" 0
  gdb_test "python print (marray\[1\]\[2\])" "o." "test multiple subscript"
 }
 
@@ -505,9 +513,9 @@ proc test_value_hash {} {
     "three = gdb.Value(3)" "" \
     "vdict = {one:\"one str\",two:\"two str\",three:\"three str\"}" "" \
     "end"
-    gdb_test "python print (vdict\[one\])" "one str" "test dictionary hash"
-    gdb_test "python print (vdict\[two\])" "two str" "test dictionary hash"
-    gdb_test "python print (vdict\[three\])" "three str" "test dictionary hash"
+    gdb_test "python print (vdict\[one\])" "one str" "test dictionary hash for one"
+    gdb_test "python print (vdict\[two\])" "two str" "test dictionary hash for two"
+    gdb_test "python print (vdict\[three\])" "three str" "test dictionary hash for three"
     gdb_test "python print (one.__hash__() == hash(one))" "True" "test inbuilt hash"
 }
 
-- 
2.14.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/4] gdb/testsuite: Make test names unique in gdb.linespec tests
  2019-09-16  2:25 [PATCH 0/4] Remove some duplicate test names Andrew Burgess
  2019-09-16  2:25 ` [PATCH 4/4] gdb/testsuite: Reduce test name duplication in gdb.python tests Andrew Burgess
  2019-09-16  2:25 ` [PATCH 3/4] gdb/testsuite: Reduce test name duplication in gdb.base tests Andrew Burgess
@ 2019-09-16  2:25 ` Andrew Burgess
  2019-09-16  2:25 ` [PATCH 1/4] gdb/testsuite: Make test names unique in gdb.reverse tests Andrew Burgess
  2019-09-18 20:42 ` [PATCH 0/4] Remove some duplicate test names Tom Tromey
  4 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2019-09-16  2:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

Make test names unique in the gdb.linespec tests.  On my local machine
this removed 43 duplicate test names.  It is possible that different
setups might still encounter some duplicates.

gdb/testsuite/ChangeLog:

	* gdb.linespec/explicit.exp: Make test names unique.
	* gdb.linespec/ls-errs.exp: Likewise.
---
 gdb/testsuite/ChangeLog                 | 5 +++++
 gdb/testsuite/gdb.linespec/explicit.exp | 6 ++++--
 gdb/testsuite/gdb.linespec/ls-errs.exp  | 5 +++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp
index e50e5033437..03f898c3c13 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -104,8 +104,10 @@ namespace eval $testfile {
 
 	# Test abbreviations
 	set short [string range $arg 0 3]
-	gdb_test "break -$short" \
-	    [string_to_regexp "missing argument for \"-$short\""]
+	if { $arg != $short } {
+	    gdb_test "break -$short" \
+		[string_to_regexp "missing argument for \"-$short\""]
+	}
     }
 
     # Test invalid arguments
diff --git a/gdb/testsuite/gdb.linespec/ls-errs.exp b/gdb/testsuite/gdb.linespec/ls-errs.exp
index f031c461cb9..0743d89bfaf 100644
--- a/gdb/testsuite/gdb.linespec/ls-errs.exp
+++ b/gdb/testsuite/gdb.linespec/ls-errs.exp
@@ -92,7 +92,8 @@ proc do_test {lang} {
 
 	gdb_test "break $linespec" [string_to_regexp \
 				    [eval format \$error_messages($msg_id) \
-				     $args]]
+				     $args]] \
+	    "'break $linespec'"
     }
 
     # Some commonly used whitespace tests around ':'.
@@ -234,7 +235,7 @@ proc do_test {lang} {
 	test_break "main:here${x}" unexpected "end of input"
     }
 
-    foreach x {"3" "+100" "-100" "foo"} {
+    foreach_with_prefix x {"3" "+100" "-100" "foo"} {
 	test_break "main 3" invalid_function "main 3"
 	test_break "-function \"main $x\"" invalid_function "main $x"
 	if {$x == "foo"} {
-- 
2.14.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Remove some duplicate test names
  2019-09-16  2:25 [PATCH 0/4] Remove some duplicate test names Andrew Burgess
                   ` (3 preceding siblings ...)
  2019-09-16  2:25 ` [PATCH 1/4] gdb/testsuite: Make test names unique in gdb.reverse tests Andrew Burgess
@ 2019-09-18 20:42 ` Tom Tromey
  2019-10-03 17:43   ` Andrew Burgess
  4 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2019-09-18 20:42 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> This series removes some (~65%) of the test name duplication we have
Andrew> within the testsuite.  The following table shows the number of
Andrew> duplicate test names broken down by test script directory before and
Andrew> after this patch series:

I skimmed these and everything seemed fine.  Thank you very much for
doing this!

I think it would probably be good to wait a few days before committing,
since the RH folks are currently in meetings and may not see this in a
timely way.  E.g., I wonder Sergio would have to tweak the buildbot
somehow when this lands.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Remove some duplicate test names
  2019-09-18 20:42 ` [PATCH 0/4] Remove some duplicate test names Tom Tromey
@ 2019-10-03 17:43   ` Andrew Burgess
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2019-10-03 17:43 UTC (permalink / raw)
  To: gdb-patches

* Tom Tromey <tom@tromey.com> [2019-09-18 14:42:36 -0600]:

> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
> 
> Andrew> This series removes some (~65%) of the test name duplication we have
> Andrew> within the testsuite.  The following table shows the number of
> Andrew> duplicate test names broken down by test script directory before and
> Andrew> after this patch series:
> 
> I skimmed these and everything seemed fine.  Thank you very much for
> doing this!
> 
> I think it would probably be good to wait a few days before committing,
> since the RH folks are currently in meetings and may not see this in a
> timely way.  E.g., I wonder Sergio would have to tweak the buildbot
> somehow when this lands.

Thanks, I checked with Sergio on IRC and he was fine with this.

I've now pushed this series.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-03 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16  2:25 [PATCH 0/4] Remove some duplicate test names Andrew Burgess
2019-09-16  2:25 ` [PATCH 4/4] gdb/testsuite: Reduce test name duplication in gdb.python tests Andrew Burgess
2019-09-16  2:25 ` [PATCH 3/4] gdb/testsuite: Reduce test name duplication in gdb.base tests Andrew Burgess
2019-09-16  2:25 ` [PATCH 2/4] gdb/testsuite: Make test names unique in gdb.linespec tests Andrew Burgess
2019-09-16  2:25 ` [PATCH 1/4] gdb/testsuite: Make test names unique in gdb.reverse tests Andrew Burgess
2019-09-18 20:42 ` [PATCH 0/4] Remove some duplicate test names Tom Tromey
2019-10-03 17:43   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).