public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/5] gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp
Date: Wed, 17 Mar 2021 11:23:58 +0000	[thread overview]
Message-ID: <ee8e5e162c6ce3090e4e124ae94f18ef73eb10eb.1615980148.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1615980148.git.andrew.burgess@embecosm.com>

The test gdb.cp/gdb2384.exp contains some duplicate test names, and
also some test names with a string inside parentheses at the end.  In
order to resolve the duplicates the obvious choice would be to add yet
more strings inside parentheses at the end of names, however, this is
discouraged in our test naming scheme.

The string in parentheses originates from a comment in the test source
code, which naturally leads to including this comment in the test
name.

In this commit I have changed the comment in the test source to remove
the string in parentheses, I then rename the tests in the .exp script
to match, making sure that all test names are unique.

There should be no change in test coverage after this commit.

gdb/testsuite/ChangeLog:

	* gdb.cp/gdb2384.cc (main): Change comments used for breakpoints.
	* gdb.cp/gdb2384.exp: Change and extend test names to avoid
	duplicates, and also to avoid having a string inside parentheses
	at the end of test names.
---
 gdb/testsuite/ChangeLog          |  7 +++++++
 gdb/testsuite/gdb.cp/gdb2384.cc  |  4 ++--
 gdb/testsuite/gdb.cp/gdb2384.exp | 20 ++++++++++----------
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/gdb2384.cc b/gdb/testsuite/gdb.cp/gdb2384.cc
index 7c734bd158a..07967b07a01 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.cc
+++ b/gdb/testsuite/gdb.cp/gdb2384.cc
@@ -46,7 +46,7 @@ main ()
 {
   derived1 d1 (42);
   derived2 d2 (24);
-  g = d1.meth (); // set breakpoint here
-  g = d2.meth (); // set breakpoint here (second)
+  g = d1.meth (); // First breakpoint
+  g = d2.meth (); // Second breakpoint
   return 0;
 }
diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp
index 69f9709f7a4..db032065186 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.exp
+++ b/gdb/testsuite/gdb.cp/gdb2384.exp
@@ -49,8 +49,8 @@ if ![runto_main] then {
     return -1
 }
 
-gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
-gdb_continue_to_breakpoint "set breakpoint here"
+gdb_breakpoint [gdb_get_line_number "First breakpoint"]
+gdb_continue_to_breakpoint "run to 'First breakpoint', first time"
 
 gdb_test "print d1.meth ()" \
     ".*42.*"
@@ -58,25 +58,25 @@ gdb_test "print d1.meth ()" \
 # Now try again.  gdb's without the fix will hopefully segv here
 
 runto_main
-gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
-gdb_continue_to_breakpoint "set breakpoint here"
+gdb_breakpoint [gdb_get_line_number "First breakpoint"]
+gdb_continue_to_breakpoint "run to 'First breakpoint', second time"
 gdb_test "print d1.meth ()" \
     ".*42.*" \
-    "gdb2384"
+    "gdb2384 at 'First breakpoint'"
 
 # second case
 
 runto_main
-gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"]
-gdb_continue_to_breakpoint "set breakpoint here (second)"
+gdb_breakpoint [gdb_get_line_number "Second breakpoint"]
+gdb_continue_to_breakpoint "run to 'Second breakpoint', first time"
 gdb_test "print d2.meth ()" \
     ".*24.*" \
     "print d2.meth()"
 
 runto_main
-gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"]
-gdb_continue_to_breakpoint "set breakpoint here (second)"
+gdb_breakpoint [gdb_get_line_number "Second breakpoint"]
+gdb_continue_to_breakpoint "run to 'Second breakpoint', second time"
 gdb_test "print d2.meth ()" \
     ".*24.*" \
-    "gdb2384 (second)"
+    "gdb2384 at 'Second breakpoint'"
 
-- 
2.25.4


  parent reply	other threads:[~2021-03-17 11:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 11:23 [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess
2021-03-17 11:23 ` [PATCH 1/5] gdb/testsuite: remove duplicate test names for gdb.cp/nsusing.exp Andrew Burgess
2021-03-17 11:23 ` Andrew Burgess [this message]
2021-03-17 11:23 ` [PATCH 3/5] gdb/testsuite: remove duplicate test from gdb.cp/maint.exp Andrew Burgess
2021-03-17 11:24 ` [PATCH 4/5] gdb/testsuite: resolve duplicate test name in gdb.cp/cplusfuncs.exp Andrew Burgess
2021-03-17 11:24 ` [PATCH 5/5] gdb/testsuite: resolve remaining duplicate test names in gdb.cp/*.exp Andrew Burgess
2021-03-26 15:03 ` [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee8e5e162c6ce3090e4e124ae94f18ef73eb10eb.1615980148.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).