diff mbox

[2/4] gdb/testsuite: Make test names unique in gdb.linespec tests

Message ID 97e00f572866266637a5190fb9afb62aba8ad09a.1568600105.git.andrew.burgess@embecosm.com
State New
Headers show

Commit Message

Andrew Burgess Sept. 16, 2019, 2:25 a.m. UTC
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 mbox

Patch

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"} {