public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp
@ 2021-03-17 11:23 Andrew Burgess
  2021-03-17 11:23 ` [PATCH 1/5] gdb/testsuite: remove duplicate test names for gdb.cp/nsusing.exp Andrew Burgess
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-17 11:23 UTC (permalink / raw)
  To: gdb-patches

Duplicate test name removal in gdb.cp/*.exp.  The first 4 patches are
more significant test changes.  The final patch picks up all the
trivial changes to squash the remaining duplicates.

---

Andrew Burgess (5):
  gdb/testsuite: remove duplicate test names for gdb.cp/nsusing.exp
  gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp
  gdb/testsuite: remove duplicate test from gdb.cp/maint.exp
  gdb/testsuite: resolve duplicate test name in gdb.cp/cplusfuncs.exp
  gdb/testsuite: resolve remaining duplicate test names in gdb.cp/*.exp

 gdb/testsuite/ChangeLog             |  40 +++++++++
 gdb/testsuite/gdb.cp/breakpoint.exp |   8 +-
 gdb/testsuite/gdb.cp/casts.exp      |   6 +-
 gdb/testsuite/gdb.cp/cplusfuncs.exp |   2 +-
 gdb/testsuite/gdb.cp/filename.exp   |   6 +-
 gdb/testsuite/gdb.cp/gdb2384.cc     |   4 +-
 gdb/testsuite/gdb.cp/gdb2384.exp    |  20 ++---
 gdb/testsuite/gdb.cp/gdb2495.exp    |   6 +-
 gdb/testsuite/gdb.cp/maint.exp      |  31 +++----
 gdb/testsuite/gdb.cp/mb-ctor.exp    |   4 +-
 gdb/testsuite/gdb.cp/misc.exp       |   2 +-
 gdb/testsuite/gdb.cp/nsnested.exp   |   9 +-
 gdb/testsuite/gdb.cp/nsusing.exp    | 133 +++++++---------------------
 gdb/testsuite/gdb.cp/ovldbreak.exp  |   6 +-
 gdb/testsuite/gdb.cp/pr17494.exp    |   2 +-
 gdb/testsuite/gdb.cp/ref-types.exp  |   2 +-
 gdb/testsuite/gdb.cp/temargs.exp    |   2 +-
 17 files changed, 134 insertions(+), 149 deletions(-)

-- 
2.25.4


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

* [PATCH 1/5] gdb/testsuite: remove duplicate test names for gdb.cp/nsusing.exp
  2021-03-17 11:23 [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess
@ 2021-03-17 11:23 ` Andrew Burgess
  2021-03-17 11:23 ` [PATCH 2/5] gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp Andrew Burgess
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-17 11:23 UTC (permalink / raw)
  To: gdb-patches

In trying to resolve the duplicate test names for the
gdb.cp/nsusing.exp script, I ended up giving the test script a serious
spring clean.

This reverts some of the changes introduced in commit df83a9bf8b0d,
but I don't think that we have lost any testing.

The test program is made of many functions, the test script wants to
stop in different functions and check which symbols are in scope.

Previously the test script would either restart GDB completely in
order to "progress" to the next function, or the script would restart
the test program using 'runto'.

In this commit I have reordered the steps of the test to correspond to
program order, I then progress through the test program once by just
placing a breakpoint and then continuing.  As I said, the test is
checking which symbols are in scope at each location, so the exact
order of the tests doesn't matter, so long as we check the correct
symbols at each location.

I have also given the comments capital letters and full stops, and
re-wrapped them to a more sensible line length.

There was a duplicate test block introduced in the df83a9bf8b0d
commit which I have removed in this commit, this duplicate code was
responsible for one of the duplicate test names.

The other duplicate test name was due to the same command being run at
different locations, in this case I just gave the two tests explicit,
unique, names.

gdb/testsuite/ChangeLog:

	* gdb.cp/nsusing.exp: Rewrite test, remove a duplicate test block.
	Avoid repeated uses of 'runto', and instread just progress once
	through the test stopping at different breakpoints.  Give comments
	a capital letter and full stop.  Give duplicate tests unique names.
---
 gdb/testsuite/ChangeLog          |   7 ++
 gdb/testsuite/gdb.cp/nsusing.exp | 133 ++++++++-----------------------
 2 files changed, 40 insertions(+), 100 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp
index ce906b096e8..8020eb03f45 100644
--- a/gdb/testsuite/gdb.cp/nsusing.exp
+++ b/gdb/testsuite/gdb.cp/nsusing.exp
@@ -13,7 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-
 standard_testfile .cc
 
 if [get_compiler_info] {
@@ -25,8 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 }
 
 ############################################
-# test printing of namespace imported within
-# the function.
+# Test printing of namespace imported within the function.
 
 if ![runto_main] then {
     perror "couldn't run to breakpoint main"
@@ -35,69 +33,19 @@ if ![runto_main] then {
 
 gdb_test "print _a" "= 1"
 
-# Test that names are not printed when they
-# are not imported
-
-gdb_breakpoint marker3
-gdb_continue_to_breakpoint "marker3"
-
-#send_gdb "break marker3\n"
-#send_gdb "continue\n"
-
-gdb_test "print _a" "No symbol \"_a\" in current context." \
-    "Print _a without import"
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-
 ############################################
-# test printing of namespace imported into
-# a scope containing the pc.
-
-if ![runto_main] then {
-    perror "couldn't run to breakpoint main"
-    continue
-}
+# Test printing of namespace imported into a scope containing the pc.
 
 gdb_breakpoint [gdb_get_line_number "marker1 stop"]
 gdb_continue_to_breakpoint "marker1 stop"
 
 gdb_test "print _a" "= 1" "print _a in a nested scope"
 
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 ############################################
-# test printing of namespace imported into
-# file scope.
+# Test printing of namespace aliases.
 
-
-if ![runto marker5] then {
-    perror "couldn't run to breakpoint marker5"
-    continue
-}
-
-gdb_test "print cc" "= 3"
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-
-############################################
-# Test printing of namespace aliases
-
-if ![runto marker2] then {
-    perror "couldn't run to breakpoint marker2"
-    continue
-}
+gdb_breakpoint marker2
+gdb_continue_to_breakpoint "marker2"
 
 gdb_test "print B::_a" "= 1"
 
@@ -107,19 +55,12 @@ gdb_test "print _a" "No symbol \"_a\" in current context." \
 gdb_test "print x" "No symbol \"x\" in current context." \
     "print x in namespace alias scope"
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-
 ############################################
 # Test that names are not printed when they
-# are not imported
+# are not imported.
 
-if {![runto marker3]} {
-    perror "couldn't run to breakpoint marker3"
-}
+gdb_breakpoint marker3
+gdb_continue_to_breakpoint "marker3"
 
 # gcc-4-3 puts import statements for aliases in
 # the global scope instead of the corresponding
@@ -128,70 +69,62 @@ if {![runto marker3]} {
 if [test_compiler_info gcc-4-3-*] then { setup_xfail *-*-* }
 
 gdb_test "print _a" "No symbol \"_a\" in current context." \
-    "Print _a without import"
+    "Print _a without import at marker3"
 
 ############################################
-# Test printing of individually imported elements
+# Test printing of individually imported elements.
 
-if ![runto marker4] then {
-    perror "couldn't run to breakpoint marker4"
-    continue
-}
+gdb_breakpoint marker4
+gdb_continue_to_breakpoint "marker4"
 
 gdb_test "print dx" "= 4"
 
 ############################################
-# Test printing of namespace aliases
+# Test printing of namespace imported into file scope.
 
-if ![runto marker5] then {
-    perror "couldn't run to marker5"
-    continue
-}
+gdb_breakpoint marker5
+gdb_continue_to_breakpoint "marker5"
+
+gdb_test "print cc" "= 3"
+
+# Also test printing of namespace aliases
 
 gdb_test "print efx" "= 5"
 
 ############################################
-# Test printing of variables imported from
-# nested namespaces
+# Test printing of variables imported from nested namespaces.
 
-if ![runto I::marker7] then {
-    perror "couldn't run to breakpoint I::marker7"
-    continue
-}
+gdb_breakpoint I::marker7
+gdb_continue_to_breakpoint "I::marker7"
 
 gdb_test "print ghx" "= 6"
 
 ############################################
-# Test that variables are not printed in a namespace
-# that is sibling to the namespace containing an import
+# Test that variables are not printed in a namespace that is sibling
+# to the namespace containing an import.
 
-if ![runto L::marker8] then {
-    perror "couldn't run to breakpoint L::marker8"
-    continue
-}
+gdb_breakpoint L::marker8
+gdb_continue_to_breakpoint "L::marker8"
 
-gdb_test "print jx" "= 44"
+gdb_test "print jx" "= 44" \
+    "print jx when the symbol is available"
 
 gdb_breakpoint "K::marker9"
 gdb_continue_to_breakpoint "K::marker9"
 
-gdb_test "print jx" "No symbol \"jx\" in current context."
+gdb_test "print jx" "No symbol \"jx\" in current context." \
+    "print jx when the symbol is not available"
 
 ############################################
-# Test that variables are only printed after the line
-# containing the import
-
-if ![runto_main] then {
-    perror "couldn't run to breakpoint main"
-    continue
-}
+# Test that variables are only printed after the line containing the
+# import.
 
 gdb_breakpoint [gdb_get_line_number "marker10 stop"]
 gdb_continue_to_breakpoint "marker10 stop"
 
 if { [test_compiler_info {gcc-[0-3]-*}] ||
      [test_compiler_info {gcc-4-[0-3]-*}]} {
-    setup_xfail *-*-* 
+    setup_xfail *-*-*
 }
 
 # Assert that M::x is printed and not N::x
-- 
2.25.4


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

* [PATCH 2/5] gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp
  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
  2021-03-17 11:23 ` [PATCH 3/5] gdb/testsuite: remove duplicate test from gdb.cp/maint.exp Andrew Burgess
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-17 11:23 UTC (permalink / raw)
  To: gdb-patches

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


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

* [PATCH 3/5] gdb/testsuite: remove duplicate test from gdb.cp/maint.exp
  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 ` [PATCH 2/5] gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp Andrew Burgess
@ 2021-03-17 11:23 ` Andrew Burgess
  2021-03-17 11:24 ` [PATCH 4/5] gdb/testsuite: resolve duplicate test name in gdb.cp/cplusfuncs.exp Andrew Burgess
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-17 11:23 UTC (permalink / raw)
  To: gdb-patches

I wanted to remove the duplicate test name from gdb.cp/maint.exp.  In
this test we run some checks against different operator names.  For
one operator we test with a variable number of spaces.  However, we
were accidentally testing the one space version twice, and the zero
space version not at all, leading to a duplicate test name.

I could have just changed the duplicate one space version into the
missing zero space version, but I thought it would be neater to wrap
multiple tests in a loop, and check all operators with either zero,
one, or two spaces.

These tests are super quick so take almost no extra time, and this
gives marginally more test coverage.

gdb/testsuite/ChangeLog:

	* gdb.cp/maint.exp (test_first_component): Run more tests with a
	variable number of spaces, this removes the duplicate testing of
	'operator ->' which existed before.
---
 gdb/testsuite/ChangeLog        |  6 ++++++
 gdb/testsuite/gdb.cp/maint.exp | 31 ++++++++++++++++---------------
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/maint.exp b/gdb/testsuite/gdb.cp/maint.exp
index 0f83b173714..358c1a40267 100644
--- a/gdb/testsuite/gdb.cp/maint.exp
+++ b/gdb/testsuite/gdb.cp/maint.exp
@@ -61,21 +61,22 @@ proc test_first_component {} {
     gdb_test_no_output "set complaints 1000"
 
     test_single_component "foo"
-    test_single_component "operator<<"
-    test_single_component "operator>>"
-    test_single_component "operator ->"
-    test_single_component "operator()"
-    test_single_component "operator>"
-    test_single_component "operator<"
-    test_single_component "operator ->"
-    test_single_component "operator  ->"
-
-    test_single_component "foo()"
-    test_single_component "foo(int)"
-    test_single_component "foo(X::Y)"
-    test_single_component "foo(X::Y, A::B)"
-    test_single_component "foo(std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >)"
-    test_single_component "operator>(X::Y)"
+
+    foreach spc [list "" " " "  "] {
+	test_single_component "operator${spc}<<"
+	test_single_component "operator${spc}>>"
+	test_single_component "operator${spc}->"
+	test_single_component "operator${spc}()"
+	test_single_component "operator${spc}>"
+	test_single_component "operator${spc}<"
+
+	test_single_component "foo${spc}()"
+	test_single_component "foo${spc}(int)"
+	test_single_component "foo${spc}(X::Y)"
+	test_single_component "foo${spc}(X::Y, A::B)"
+	test_single_component "foo${spc}(std::basic_streambuf<wchar_t,std::char_traits<wchar_t> >)"
+	test_single_component "operator>${spc}(X::Y)"
+    }
 
     # Operator names can show up in weird places.
 
-- 
2.25.4


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

* [PATCH 4/5] gdb/testsuite: resolve duplicate test name in gdb.cp/cplusfuncs.exp
  2021-03-17 11:23 [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess
                   ` (2 preceding siblings ...)
  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 ` 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
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-17 11:24 UTC (permalink / raw)
  To: gdb-patches

While resolving duplicate test names I spotted that a test in
gdb.cp/cplusfuncs.exp included an unescaped '[]'.  In TCL square
brackets enclose expressions to evaluate, and so in this case, where
there is no enclosed expression, this just evaluates to the empty
string.

This clearly was not what the test intended, so in this commit I have
escaped the square brackets.  This has extended the test coverage.

gdb/testsuite/ChangeLog:

	* gdb.cp/cplusfuncs.exp (test_paddr_operator_functions): Escape
	square brackets in test.
---
 gdb/testsuite/ChangeLog             | 5 +++++
 gdb/testsuite/gdb.cp/cplusfuncs.exp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp
index 8e24db5db0d..f1c2ff4907f 100644
--- a/gdb/testsuite/gdb.cp/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp
@@ -497,7 +497,7 @@ proc test_paddr_operator_functions {} {
 	" = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>"    
 
     print_addr "foo::operator delete($dm_type_void_star)"
-    print_addr "foo::operator delete[]($dm_type_void_star)"
+    print_addr "foo::operator delete\[\]($dm_type_void_star)"
 
     print_addr "foo::operator int($dm_type_void)"
     print_addr "foo::operator $dm_operator_char_star\($dm_type_void)"
-- 
2.25.4


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

* [PATCH 5/5] gdb/testsuite: resolve remaining duplicate test names in gdb.cp/*.exp
  2021-03-17 11:23 [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess
                   ` (3 preceding siblings ...)
  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 ` Andrew Burgess
  2021-03-26 15:03 ` [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-17 11:24 UTC (permalink / raw)
  To: gdb-patches

This commit resolves the remaining duplicate test names in
gdb.cp/*.exp.  These are all the easy duplicates, I'm either giving
tests a new, unique name, extending an existing name to make it
unique, or changing an existing name to better reflect what the test
is actually doing, and thus, making this test name unique.

There should be no change in what is tested after this commit.

gdb/testsuite/ChangeLog:

	* gdb.cp/breakpoint.exp: Extend test names to make them unique.
	* gdb.cp/casts.exp: Give tests unique names.
	* gdb.cp/filename.exp: Likewise.
	* gdb.cp/gdb2495.exp: Likewise.
	* gdb.cp/mb-ctor.exp: Extend test names to make them unique.
	* gdb.cp/misc.exp: Rename test to make it unique.
	* gdb.cp/nsnested.exp: Give tests unique names.
	* gdb.cp/ovldbreak.exp: Likewise.
	* gdb.cp/pr17494.exp: Rename test to reflect what is actually
	being tested.  This also removes the duplicate test name.
	* gdb.cp/ref-types.exp: Likewise.
	* gdb.cp/temargs.exp: Likewise.
---
 gdb/testsuite/ChangeLog             | 15 +++++++++++++++
 gdb/testsuite/gdb.cp/breakpoint.exp |  8 ++++----
 gdb/testsuite/gdb.cp/casts.exp      |  6 ++++--
 gdb/testsuite/gdb.cp/filename.exp   |  6 ++++--
 gdb/testsuite/gdb.cp/gdb2495.exp    |  6 ++++--
 gdb/testsuite/gdb.cp/mb-ctor.exp    |  4 ++--
 gdb/testsuite/gdb.cp/misc.exp       |  2 +-
 gdb/testsuite/gdb.cp/nsnested.exp   |  9 ++++++---
 gdb/testsuite/gdb.cp/ovldbreak.exp  |  6 ++++--
 gdb/testsuite/gdb.cp/pr17494.exp    |  2 +-
 gdb/testsuite/gdb.cp/ref-types.exp  |  2 +-
 gdb/testsuite/gdb.cp/temargs.exp    |  2 +-
 12 files changed, 47 insertions(+), 21 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/breakpoint.exp b/gdb/testsuite/gdb.cp/breakpoint.exp
index 3f2e8229a2d..e98b79e5dc2 100644
--- a/gdb/testsuite/gdb.cp/breakpoint.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint.exp
@@ -51,10 +51,10 @@ set bp_location1 [gdb_get_line_number "conditional breakpoint in method"]
 set bp_location2 [gdb_get_line_number "conditional breakpoint in method 2"]
 gdb_test "break $bp_location1 if i_==3" ".*Breakpoint.*" "conditional breakpoint in method"
 gdb_test "break $bp_location2 if i_==3" ".*Breakpoint.*" "conditional breakpoint in method 2"
-gdb_test "continue" ".*Breakpoint.*C1::foo.*" "continue to breakpoint"
-gdb_test "print i_" "\\\$1 = 3" "check the member variable"
-gdb_test "continue" ".*Breakpoint.*C1::bar.*" "continue to breakpoint"
-gdb_test "print i_" "\\\$2 = 3" "check the member variable"
+gdb_test "continue" ".*Breakpoint.*C1::foo.*" "continue to breakpoint in C1::foo"
+gdb_test "print i_" "\\\$1 = 3" "check the member variable from within C1::foo"
+gdb_test "continue" ".*Breakpoint.*C1::bar.*" "continue to breakpoint in C1::bar"
+gdb_test "print i_" "\\\$2 = 3" "check the member variable from within C1::bar"
 
 
 gdb_exit
diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp
index beb3c94ce8c..7bd879c4112 100644
--- a/gdb/testsuite/gdb.cp/casts.exp
+++ b/gdb/testsuite/gdb.cp/casts.exp
@@ -43,7 +43,8 @@ if ![runto_main] then {
 }
 
 # Prevent symbol on address 0x0 being printed.
-gdb_test_no_output "set print symbol off"
+gdb_test_no_output "set print symbol off"  \
+    "turn of symbol printing for the first time"
 
 gdb_test "break [gdb_get_line_number "casts.exp: 1"]" \
     "Breakpoint.*at.* file .*" \
@@ -184,7 +185,8 @@ if ![runto_main] then {
 }
 
 # Prevent symbol on address 0x0 being printed.
-gdb_test_no_output "set print symbol off"
+gdb_test_no_output "set print symbol off" \
+    "turn of symbol printing for the second time"
 
 gdb_breakpoint [gdb_get_line_number "casts.exp: 1" $srcfile2]
 gdb_continue_to_breakpoint "end of casts03"
diff --git a/gdb/testsuite/gdb.cp/filename.exp b/gdb/testsuite/gdb.cp/filename.exp
index bf12ac6365b..3a2e9bd88bc 100644
--- a/gdb/testsuite/gdb.cp/filename.exp
+++ b/gdb/testsuite/gdb.cp/filename.exp
@@ -31,14 +31,16 @@ gdb_continue_to_breakpoint "stop inside C"
 
 gdb_test "print includefile\[0\]" " = 23"
 gdb_test "print this->includefile\[0\]" " = 23"
-gdb_test "print 'includefile'::some_global" " = 27"
+gdb_test "print 'includefile'::some_global" " = 27" \
+    "print some_global from within C"
 
 gdb_breakpoint [gdb_get_line_number "stop inside D"]
 gdb_continue_to_breakpoint "stop inside D"
 
 gdb_test "print includefile()" " = 24"
 gdb_test "print this->includefile()" " = 24"
-gdb_test "print 'includefile'::some_global" " = 27"
+gdb_test "print 'includefile'::some_global" " = 27"  \
+    "print some_global from within D"
 
 gdb_breakpoint [gdb_get_line_number "stop outside"]
 gdb_continue_to_breakpoint "stop outside"
diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
index a52368f12e4..5eb13ac9a90 100644
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
@@ -122,7 +122,8 @@ gdb_test "show unwindonsignal" \
 # Check to see if new behaviour interferes with
 # normal signal handling in inferior function calls.
 gdb_test "p exceptions.raise_signal(1)" \
-    "To change this behavior use \"set unwindonsignal off\".*"
+    "To change this behavior use \"set unwindonsignal off\".*" \
+    "check for unwindonsignal off message"
 
 # And reverse - turn off again.
 gdb_test_no_output "set unwindonsignal off"
@@ -135,4 +136,5 @@ gdb_test "show unwindonsignal" \
 # Check to see if new behaviour interferes with
 # normal signal handling in inferior function calls.
 gdb_test "p exceptions.raise_signal(1)" \
-    "To change this behavior use \"set unwindonsignal on\".*"
+    "To change this behavior use \"set unwindonsignal on\".*" \
+    "check for unwindonsignal on message"
diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp
index 9bbfb55ddc8..ae352adc0ce 100644
--- a/gdb/testsuite/gdb.cp/mb-ctor.exp
+++ b/gdb/testsuite/gdb.cp/mb-ctor.exp
@@ -51,13 +51,13 @@ gdb_test "continue" \
     ".*Breakpoint.*Derived.*i=7.*" \
     "run to breakpoint 1 v1"
 
-gdb_continue_to_breakpoint "set breakpoint here" ".* breakpoint here"
+gdb_continue_to_breakpoint "set breakpoint here, first time" ".* breakpoint here"
 
 gdb_test "continue" \
     ".*Breakpoint.*Derived.*i=15.*" \
     "run to breakpoint 1 v2"
 
-gdb_continue_to_breakpoint "set breakpoint here" ".* breakpoint here"
+gdb_continue_to_breakpoint "set breakpoint here, second time" ".* breakpoint here"
 
 gdb_test "continue" \
     ".*Breakpoint.*~Derived.*" \
diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp
index aa830312ba1..8219b23d618 100644
--- a/gdb/testsuite/gdb.cp/misc.exp
+++ b/gdb/testsuite/gdb.cp/misc.exp
@@ -111,6 +111,6 @@ gdb_test "print 'misc.cc'::v_bool" " = true" \
 gdb_test "print *(v_bool_array + number_ref)" "\\$\[0-9\]* = false" \
     "pointer addition with integer reference"
 gdb_test "print *(number_ref + v_bool_array)" "\\$\[0-9\]* = false" \
-    "pointer addition with integer reference"
+    "integer reference addition with pointer"
 gdb_test "print *(v_bool_array - number_ref)" "\\$\[0-9\]* = false" \
     "pointer subtraction with integer reference"
diff --git a/gdb/testsuite/gdb.cp/nsnested.exp b/gdb/testsuite/gdb.cp/nsnested.exp
index 965deadd570..4e5bd5e5c62 100644
--- a/gdb/testsuite/gdb.cp/nsnested.exp
+++ b/gdb/testsuite/gdb.cp/nsnested.exp
@@ -25,17 +25,20 @@ if ![runto_main] then {
     continue
 }
 
-gdb_test "print ab" "No symbol .* in current context."
+gdb_test "print ab" "No symbol .* in current context." \
+    "ensure symbol ab is not known in main"
 
 ############################################
 gdb_breakpoint C::first
 gdb_continue_to_breakpoint "C::first"
 
-gdb_test "print ab" "No symbol .* in current context."
+gdb_test "print ab" "No symbol .* in current context."  \
+    "ensure symbol ab is not known in C::first"
 gdb_test "print C::D::ab" "= 11"
 
 ############################################
 gdb_breakpoint C::D::second
 gdb_continue_to_breakpoint "C::D::second"
 
-gdb_test "print ab" "= 11"
+gdb_test "print ab" "= 11"  \
+    "ensure symbol ab is known in C::D::second"
diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
index 1a61c7d0f1f..ca04d499605 100644
--- a/gdb/testsuite/gdb.cp/ovldbreak.exp
+++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
@@ -388,13 +388,15 @@ foreach type $all_types {
 # is set to "cancel"
 gdb_test_no_output "set multiple-symbols cancel"
 gdb_test "break foo::foofunc" \
-         "canceled.*"
+    "canceled.*" \
+    "break on ambiguous symbol when multiple-symbols is set to cancel"
 
 # Test breaking on an overloaded function when multiple-symbols
 # is set to "all"
 gdb_test_no_output "set multiple-symbols all"
 gdb_test "break foo::foofunc" \
-         "Breakpoint \[0-9\]+ at ${hex}: foo::foofunc. .2 locations..*"
+    "Breakpoint \[0-9\]+ at ${hex}: foo::foofunc. .2 locations..*" \
+    "break on ambiguous symbol when multiple-symbols is set to all"
 
 # That's all, folks.
 
diff --git a/gdb/testsuite/gdb.cp/pr17494.exp b/gdb/testsuite/gdb.cp/pr17494.exp
index 127978b0084..066c4631f30 100644
--- a/gdb/testsuite/gdb.cp/pr17494.exp
+++ b/gdb/testsuite/gdb.cp/pr17494.exp
@@ -31,7 +31,7 @@ gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
 gdb_test "p a.geta()" ".* = 12345" "a.geta()"
-gdb_test "p a_ptr->geta()" ".* = 12345" "a.geta()"
+gdb_test "p a_ptr->geta()" ".* = 12345" "a_ptr->geta()"
 
 gdb_test "p false ? a.geta() : 123" ".* = 123" "ternop 1"
 gdb_test "p false ? a_ptr->geta() : 123" ".* = 123" "ternop 2"
diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp
index e38aad45731..9bd93f32602 100644
--- a/gdb/testsuite/gdb.cp/ref-types.exp
+++ b/gdb/testsuite/gdb.cp/ref-types.exp
@@ -242,7 +242,7 @@ gdb_test "print rI" ".\[0-9\]* = \\(int &\\) @$hex: 102" \
 
 gdb_test "print rUI" \
     ".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002" \
-        "print value of UI"
+        "print value of rUI"
 
 gdb_test_multiple "print rL" "print value of rL" {
     -re ".\[0-9\]* = \\(long &\\) @$hex: -234.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp
index f372cc3f0fc..58c3c0a1cfe 100644
--- a/gdb/testsuite/gdb.cp/temargs.exp
+++ b/gdb/testsuite/gdb.cp/temargs.exp
@@ -136,7 +136,7 @@ gdb_test "print I" " = 91" "test value of I in func"
 
 # PR symtab/16842 - gdb used to crash here.
 if $have_older_template_gcc { setup_xfail "*-*-*" }
-gdb_test "info addr I" "Symbol \"I\" is constant." "test address of I in templ_m"
+gdb_test "info addr I" "Symbol \"I\" is constant." "test address of I in func"
 
 if $have_older_template_gcc { setup_xfail "*-*-*" }
 gdb_test "print P == &a_global" " = true" "test value of P in func"
-- 
2.25.4


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

* Re: [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp
  2021-03-17 11:23 [PATCH 0/5] Remove duplicate test names from gdb.cp/*.exp Andrew Burgess
                   ` (4 preceding siblings ...)
  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 ` Andrew Burgess
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2021-03-26 15:03 UTC (permalink / raw)
  To: gdb-patches

* Andrew Burgess <andrew.burgess@embecosm.com> [2021-03-17 11:23:56 +0000]:

> Duplicate test name removal in gdb.cp/*.exp.  The first 4 patches are
> more significant test changes.  The final patch picks up all the
> trivial changes to squash the remaining duplicates.
> 
> ---
> 
> Andrew Burgess (5):
>   gdb/testsuite: remove duplicate test names for gdb.cp/nsusing.exp
>   gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp
>   gdb/testsuite: remove duplicate test from gdb.cp/maint.exp
>   gdb/testsuite: resolve duplicate test name in gdb.cp/cplusfuncs.exp
>   gdb/testsuite: resolve remaining duplicate test names in gdb.cp/*.exp

I've now pushed this series.

Thanks,
Andrew

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

end of thread, other threads:[~2021-03-26 15:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/5] gdb/testsuite: remove duplicate test names from gdb.cp/gdb2384.exp Andrew Burgess
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

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).