[commit] a bit of cleanup in a couple of gdb.multi/ tests

Pedro Alves pedro@codesourcery.com
Fri Jun 18 15:12:00 GMT 2010


I was diffing test results in two different build trees, and noticed:

 -PASS: gdb.multi/base.exp: file /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.multi/hangout
 -PASS: gdb.multi/base.exp: add-inferior -exec /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.multi/goodbye
 +PASS: gdb.multi/base.exp: file /home/pedro/gdb/dan/build/gdb/testsuite/gdb.multi/hangout
 +PASS: gdb.multi/base.exp: add-inferior -exec /home/pedro/gdb/dan/build/gdb/testsuite/gdb.multi/goodbye

 -PASS: gdb.multi/bkpt-multi-exec.exp: add-inferior -exec /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.multi/crashme
 +PASS: gdb.multi/bkpt-multi-exec.exp: add-inferior -exec /home/pedro/gdb/dan/build/gdb/testsuite/gdb.multi/crashme

There's no need to leak the full paths.  While I was there, I noticed
not all tests had distinct messages.

All fixed with this patch.  I've applied it.

-- 
Pedro Alves

2010-06-18  Pedro Alves  <pedro@codesourcery.com>

	* gdb.multi/base.exp, gdb.multi/bkpt-multi-exec.exp: Use
	clean_restart, make sure every test has a distinct message, and
	that messages don't include the executable' full path.

---
 gdb/testsuite/gdb.multi/base.exp            |   40 ++++++++++++++--------------
 gdb/testsuite/gdb.multi/bkpt-multi-exec.exp |   14 +++------
 2 files changed, 26 insertions(+), 28 deletions(-)

Index: src/gdb/testsuite/gdb.multi/base.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.multi/base.exp	2010-06-18 14:46:20.000000000 +0100
+++ src/gdb/testsuite/gdb.multi/base.exp	2010-06-18 15:03:52.000000000 +0100
@@ -42,20 +42,19 @@ if { [prepare_for_testing ${testfile}.ex
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile1}
+clean_restart ${exec1}
 
 # Add an empty inferior space, switch to it, and load a main
 # executable into it.
-gdb_test "add-inferior" "Added inferior 2.*"
-gdb_test "inferior 2" "Switching to inferior 2.*"
-gdb_test "file ${binfile2}" ".*"
+gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
+gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
+gdb_test "file ${binfile2}" ".*" "load ${exec2} file in inferior 2"
 
 # Add a new inferior space and load a main executable into it in one
 # command.
-gdb_test "add-inferior -exec ${binfile3}"
+gdb_test "add-inferior -exec ${binfile3}" \
+    "Added inferior 3.*" \
+    "add inferior 3 with -exec ${exec3}"
 
 # Check that we have multiple spaces.
 
@@ -64,35 +63,38 @@ gdb_test "info inferiors" \
 
 # Test that we have multiple symbol tables.
 
-gdb_test "inferior 1"
-gdb_test "info functions commonfun" "${srcfile1}.*"
+gdb_test "inferior 1" ".*" "switch to inferior 1"
+gdb_test "info functions commonfun" \
+    "${srcfile1}.*" \
+    "'info functions commonfun' in inferior 1"
+
+gdb_test "inferior 3" ".*" "switch to inferior 3"
+gdb_test "info functions commonfun" \
+    "${srcfile3}.*" \
+    "'info functions commonfun' in inferior 3"
 
-gdb_test "inferior 3"
-gdb_test "info functions commonfun" "${srcfile3}.*"
-
-
-gdb_test "inferior 1"
+gdb_test "inferior 1" ".*" "switch back to inferior 1"
 
 gdb_test_no_output "set listsize 1"
 
-gdb_test "list commonfun" "from hello.*"
+gdb_test "list commonfun" "from hello.*" "list commonfun in hello"
 
 gdb_test "print hglob" "1"
 
 gdb_test "print glob" "92" "print glob (${exec1})"
 
 
-gdb_test "inferior 3"
+gdb_test "inferior 3" ".*" "switch to inferior 3 to print globals"
 
 gdb_test "print gglob" "2"
 
 gdb_test "print glob" "45" "print glob (${exec3})"
 
-gdb_test "list commonfun" "from goodbye.*"
+gdb_test "list commonfun" "from goodbye.*" "list commonfun in goodbye"
 
 
 # Let's run the hello program.
-gdb_test "inferior 1"
+gdb_test "inferior 1" ".*" "switch to inferior 1 to run it"
 
 if { ![runto_main] } then {
     return -1
Index: src/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp	2010-06-18 14:41:21.000000000 +0100
+++ src/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp	2010-06-18 14:53:46.000000000 +0100
@@ -42,10 +42,7 @@ if {![istarget "hppa*-hp-hpux*"] && ![is
 
 # Start with a fresh gdb
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile1}
+clean_restart ${exec1}
 
 # Start the program running, and stop at main.
 #
@@ -61,12 +58,11 @@ gdb_test "continue" "SIGSEGV.*"
 
 # Start over, but this time, set a breakpoint before the app crashes.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile1}
+clean_restart ${exec1}
 
-gdb_test "add-inferior -exec ${binfile2}"
+gdb_test "add-inferior -exec ${binfile2}" \
+    "Added inferior 2.*" \
+    "add inferior 2 with -exec ${exec2}"
 
 set bp_location [gdb_get_line_number "set breakpoint here" ${srcfile2}]
 



More information about the Gdb-patches mailing list