This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: cleanups for gdb.go
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 25 Jun 2012 13:13:01 -0600
- Subject: FYI: cleanups for gdb.go
I'm checking this in.
This changes gdb.go to use the new "standard" test suite procs.
Regtested on x86-64 Fedora 16.
Tom
2012-06-25 Tom Tromey <tromey@redhat.com>
* lib/gdb.exp (standard_output_file): Use "file join".
* gdb.go/chan.exp: Use standard_testfile.
* gdb.go/handcall.exp: Use standard_testfile.
* gdb.go/hello.exp: Use standard_testfile.
* gdb.integers/chan.exp: Use standard_testfile.
* gdb.go/methods.exp: Use standard_testfile.
* gdb.go/package.exp: Use standard_testfile.
* gdb.go/strings.exp: Use standard_testfile.
* gdb.go/types.exp: Use standard_testfile.
* gdb.go/unsafe.exp: Use standard_testfile.
Index: gdb.go/chan.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/chan.exp,v
retrieving revision 1.1
diff -u -r1.1 chan.exp
--- gdb.go/chan.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/chan.exp 25 Jun 2012 19:11:47 -0000
@@ -22,8 +22,7 @@
if { [skip_go_tests] } { continue }
-set testfile "chan"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/handcall.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/handcall.exp,v
retrieving revision 1.1
diff -u -r1.1 handcall.exp
--- gdb.go/handcall.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/handcall.exp 25 Jun 2012 19:11:47 -0000
@@ -21,8 +21,7 @@
if { [skip_go_tests] } { continue }
-set testfile "handcall"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/hello.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/hello.exp,v
retrieving revision 1.1
diff -u -r1.1 hello.exp
--- gdb.go/hello.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/hello.exp 25 Jun 2012 19:11:47 -0000
@@ -21,8 +21,7 @@
if { [skip_go_tests] } { continue }
-set testfile "hello"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/integers.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/integers.exp,v
retrieving revision 1.1
diff -u -r1.1 integers.exp
--- gdb.go/integers.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/integers.exp 25 Jun 2012 19:11:47 -0000
@@ -21,8 +21,7 @@
if { [skip_go_tests] } { continue }
-set testfile "integers"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/methods.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/methods.exp,v
retrieving revision 1.1
diff -u -r1.1 methods.exp
--- gdb.go/methods.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/methods.exp 25 Jun 2012 19:11:47 -0000
@@ -21,8 +21,7 @@
if { [skip_go_tests] } { continue }
-set testfile "methods"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/package.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/package.exp,v
retrieving revision 1.1
diff -u -r1.1 package.exp
--- gdb.go/package.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/package.exp 25 Jun 2012 19:11:47 -0000
@@ -21,21 +21,13 @@
if { [skip_go_tests] } { continue }
-set testfile "package"
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile package1.go package2.go
-if { [gdb_compile "${srcdir}/${subdir}/${testfile}2.go" "${binfile}2.o" object {debug go}] != "" } {
- untested $testfile
+if {[prepare_for_testing $testfile.exp $testfile [list $srcfile $srcfile2] \
+ [list debug go libdir=[standard_output_file {}]]]} {
return -1
}
-if { [gdb_compile "${srcdir}/${subdir}/${testfile}1.go ${binfile}2.o" "${binfile}" executable "debug go libdir=${objdir}/${subdir}"] != "" } {
- untested $testfile
- return -1
-}
-
-clean_restart $testfile
-
if { [go_runto_main] < 0 } {
untested methods
return -1
Index: gdb.go/strings.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/strings.exp,v
retrieving revision 1.1
diff -u -r1.1 strings.exp
--- gdb.go/strings.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/strings.exp 25 Jun 2012 19:11:47 -0000
@@ -19,8 +19,7 @@
if { [skip_go_tests] } { continue }
-set testfile "strings"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/types.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/types.exp,v
retrieving revision 1.1
diff -u -r1.1 types.exp
--- gdb.go/types.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/types.exp 25 Jun 2012 19:11:47 -0000
@@ -21,8 +21,7 @@
if { [skip_go_tests] } { continue }
-set testfile "types"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: gdb.go/unsafe.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.go/unsafe.exp,v
retrieving revision 1.1
diff -u -r1.1 unsafe.exp
--- gdb.go/unsafe.exp 25 Apr 2012 14:07:23 -0000 1.1
+++ gdb.go/unsafe.exp 25 Jun 2012 19:11:47 -0000
@@ -21,8 +21,7 @@
if { [skip_go_tests] } { continue }
-set testfile "unsafe"
-set srcfile ${testfile}.go
+standard_testfile .go
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
return -1
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.208
diff -u -r1.208 gdb.exp
--- lib/gdb.exp 22 Jun 2012 16:39:11 -0000 1.208
+++ lib/gdb.exp 25 Jun 2012 19:11:48 -0000
@@ -3067,12 +3067,13 @@
}
# Turn BASENAME into a full file name in the standard output
-# directory.
+# directory. It is ok if BASENAME is the empty string; in this case
+# the directory is returned.
proc standard_output_file {basename} {
global objdir subdir
- return $objdir/$subdir/$basename
+ return [file join $objdir $subdir $basename]
}
# Set 'testfile', 'srcfile', and 'binfile'.