FYI: do not include full file names in test names

Tom Tromey tromey@redhat.com
Tue Oct 18 16:08:00 GMT 2011


I'm checking this in.

While digging through gdb.sum diffs, I noticed a couple of places where
a file name appears in a test name, e.g.:

PASS: gdb.python/python.exp: source ../../../archer/gdb/testsuite/gdb.python/source2.py

This yields spurious differences if you do builds in different
directories.

This patch changes the tests to have location-independent names.

Tom

2011-10-18  Tom Tromey  <tromey@redhat.com>

	* gdb.base/source.exp: Don't include full file name in test name.
	* gdb.python/python.exp: Don't include full file name in test
	name.

Index: gdb.base/source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/source.exp,v
retrieving revision 1.15
diff -u -r1.15 source.exp
--- gdb.base/source.exp	1 Jan 2011 15:33:42 -0000	1.15
+++ gdb.base/source.exp	18 Oct 2011 14:12:09 -0000
@@ -49,7 +49,8 @@
     }
 }
 
-gdb_test "dir ${srcdir}/${subdir}" "Source directories searched: .*"
+gdb_test "dir ${srcdir}/${subdir}" "Source directories searched: .*" \
+    "set search directories"
 gdb_test "source -s ./source-test.gdb" \
     "test source options" \
     "source -s"
Index: gdb.python/python.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/python.exp,v
retrieving revision 1.26
diff -u -r1.26 python.exp
--- gdb.python/python.exp	30 Sep 2011 15:07:33 -0000	1.26
+++ gdb.python/python.exp	18 Oct 2011 14:12:09 -0000
@@ -47,7 +47,9 @@
 
       # If Python is not supported, verify that sourcing a python script
       # causes an error.
-      gdb_test "source $srcdir/$subdir/source2.py" "Error in sourced command file:.*"
+      gdb_test "source $srcdir/$subdir/source2.py" \
+	  "Error in sourced command file:.*" \
+	  "source source2.py when python disabled"
       return -1
     }
     -re "$gdb_prompt $"	{}
@@ -73,7 +75,7 @@
   "foo ()" "" \
   "end" "hello, world!"
 
-gdb_test "source $srcdir/$subdir/source2.py" "yes"
+gdb_test "source $srcdir/$subdir/source2.py" "yes" "source source2.py"
 
 gdb_test "python print gdb.current_objfile()" "None"
 gdb_test "python print gdb.objfiles()" "\\\[\\\]"



More information about the Gdb-patches mailing list