public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Make test names unique in gdb.base/maint.exp
@ 2018-05-04 15:03 Andrew Burgess
  2018-05-04 15:33 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Burgess @ 2018-05-04 15:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

Add prefixes or suffixes to some test names to make them unique.

Replace a send_gdb/gdb_expect with a gdb_test, and make the test name
unique.

Remove test of 'help maint' as this is already covered by a later call
to test_prefix_command_help.

Removed test of 'help maint info' and add a new call to
test_prefix_command_help instead.

gdb/testsuite/ChangeLog:

	* gdb.base/maint.exp: Make test names unique, use
	test_prefix_command_help to test 'help maint info', and remove
	repeated test of 'help maint'.
---
 gdb/testsuite/ChangeLog          |  6 ++++++
 gdb/testsuite/gdb.base/maint.exp | 25 +++++++++----------------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index f576cb38402..aefaeb01387 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -261,7 +261,7 @@ if { ! $have_gdb_index } {
 				timeout { fail "$test_name (timeout)" }
 			    }
 			    gdb_test "shell rm -f $psymbols_output" ".*" \
-				"shell rm -f psymbols_output"
+				"${test_name}: shell rm -f psymbols_output"
 			}
 			-re ".*$gdb_prompt $" { fail "$test_name" }
 			timeout { fail "$test_name (timeout)" }
@@ -282,14 +282,9 @@ gdb_expect  {
 	send_gdb "shell ls $msymbols_output\n"
 	gdb_expect {
 	    -re "$msymbols_output_re\r\n$gdb_prompt $" {
-		send_gdb "shell grep factorial $msymbols_output\n"
-		gdb_expect {
-		    -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*$gdb_prompt $" {
-			pass "maint print msymbols"
-		    }
-		    -re ".*$gdb_prompt $" { fail "maint print msymbols" }
-		    timeout { fail "maint print msymbols (timeout)" }
-		}
+		gdb_test "shell grep factorial $msymbols_output" \
+		    "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*" \
+		    "maint print msymbols, absolute pathname"
 		gdb_test "shell rm -f $msymbols_output" ".*" \
 		    "shell rm -f msymbols_output"
 	    }
@@ -313,7 +308,7 @@ gdb_test_multiple "maint print msymbols -objfile ${testfile} msymbols_output2" "
 	    -re "msymbols_output2\r\n$gdb_prompt $" {
 		gdb_test "shell grep factorial msymbols_output2" \
 		    "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*" \
-		    "maint print msymbols"
+		    "maint print msymbols, relative pathname"
 		gdb_test "shell rm -f msymbols_output2" ".*"
 	    }
 	}
@@ -352,7 +347,7 @@ foreach { test_name command } $test_list {
 			timeout { fail "$test_name (timeout)" }
 		    }
 		    gdb_test "shell rm -f $symbols_output" ".*" \
-			"shell rm -f symbols_output"
+			"$test_name: shell rm -f symbols_output"
 		}
 		-re ".*$gdb_prompt $" { fail "$test_name" }
 		timeout { fail "$test_name (timeout)" }
@@ -533,11 +528,9 @@ set timeout $oldtimeout
 
 #============test help on maint commands
 
-gdb_test "help maint" \
-    "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core, etc\\..*List of maintenance subcommands:.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance set.*maintenance show.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*" 
-
-gdb_test "help maint info" \
-    "Commands for showing internal info about the program being debugged.*unambiguous\\..*"
+test_prefix_command_help {"maint info" "maintenance info"} {
+    "Commands for showing internal info about the program being debugged\\.\[\r\n\]+"
+}
 
 test_prefix_command_help {"maint print" "maintenance print"} {
     "Maintenance command for printing GDB internal state\\.\[\r\n\]+"
-- 
2.14.3

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

* Re: [PATCH] gdb: Make test names unique in gdb.base/maint.exp
  2018-05-04 15:03 [PATCH] gdb: Make test names unique in gdb.base/maint.exp Andrew Burgess
@ 2018-05-04 15:33 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2018-05-04 15:33 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 05/04/2018 04:02 PM, Andrew Burgess wrote:
> Add prefixes or suffixes to some test names to make them unique.
> 
> Replace a send_gdb/gdb_expect with a gdb_test, and make the test name
> unique.
> 
> Remove test of 'help maint' as this is already covered by a later call
> to test_prefix_command_help.
> 
> Removed test of 'help maint info' and add a new call to
> test_prefix_command_help instead.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.base/maint.exp: Make test names unique, use
> 	test_prefix_command_help to test 'help maint info', and remove
> 	repeated test of 'help maint'.

OK.

Thanks,
Pedro Alves

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

end of thread, other threads:[~2018-05-04 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04 15:03 [PATCH] gdb: Make test names unique in gdb.base/maint.exp Andrew Burgess
2018-05-04 15:33 ` Pedro Alves

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