This libgo patch sets the name of the test correctly when using DejaGNU
to run the libgo testsuite.  Bootstrapped and ran libgo testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 66deaac7efb2 libgo/Makefile.am
--- a/libgo/Makefile.am	Thu Mar 31 15:34:36 2011 -0700
+++ b/libgo/Makefile.am	Thu Mar 31 15:58:43 2011 -0700
@@ -1551,7 +1551,7 @@
 	prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \
 	test "$${prefix}" != "." || prefix="$(@D)"; \
 	if test "$(use_dejagnu)" = "yes"; then \
-	  $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" $(GOTESTFLAGS); \
+	  $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --testname="$(@D)" $(GOTESTFLAGS); \
 	else \
 	  if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
 	    echo "PASS: $(@D)"; \
diff -r 66deaac7efb2 libgo/testsuite/gotest
--- a/libgo/testsuite/gotest	Thu Mar 31 15:34:36 2011 -0700
+++ b/libgo/testsuite/gotest	Thu Mar 31 15:58:43 2011 -0700
@@ -33,6 +33,7 @@
 prefix=
 dejagnu=no
 timeout=60
+testname=""
 while $loop; do
 	case "x$1" in
         x--srcdir)
@@ -93,6 +94,15 @@
 		timeout=`echo $1 | sed -e 's/^--timeout=//'`
 		shift
 		;;
+	x--testname)
+		testname=$2
+		shift
+		shift
+		;;
+	x--testname=*)
+		testname=`echo $1 | sed -e 's/^--testname=//'`
+		shift
+		;;
 	x-*)
 		loop=false
 		;;
@@ -386,6 +396,10 @@
 	cd ../testsuite
 	rm -rf _obj _test
 	mkdir _obj _test
+	if test "$testname" != ""; then
+	    GOTESTNAME="$testname"
+	    export GOTESTNAME
+	fi
 	$MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR"
 	# Useful when using make check-target-libgo
 	cat libgo.log >> libgo-all.log
diff -r 66deaac7efb2 libgo/testsuite/libgo.testmain/testmain.exp
--- a/libgo/testsuite/libgo.testmain/testmain.exp	Thu Mar 31 15:34:36 2011 -0700
+++ b/libgo/testsuite/libgo.testmain/testmain.exp	Thu Mar 31 15:58:43 2011 -0700
@@ -57,4 +57,10 @@
 set result [libgo_load "./a.exe" "-test.short" ""]
 
 set status [lindex $result 0]
-$status go
+
+set name "go"
+if [info exists env(GOTESTNAME)] {
+    set name "$env(GOTESTNAME)"
+}
+
+$status $name

Reply via email to