aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-31 23:03:20 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-31 23:03:20 +0000
commit0be16c20b1c2b93943d0f97af985d818a4e66ffb (patch)
tree243d79a0e22b59f9a03224062a755bab9b908b3e
parentec840af4d87c856dfdcd8a7e36136ca182dabb99 (diff)
libgo: Set name of test when using DejaGNU tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171805 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgo/Makefile.am2
-rw-r--r--libgo/Makefile.in2
-rwxr-xr-xlibgo/testsuite/gotest14
-rw-r--r--libgo/testsuite/libgo.testmain/testmain.exp8
4 files changed, 23 insertions, 3 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 45365a18c92..cf6975d2db9 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -1551,7 +1551,7 @@ CHECK = \
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 --git a/libgo/Makefile.in b/libgo/Makefile.in
index d4184cab459..306b9e43d43 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -1881,7 +1881,7 @@ CHECK = \
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 --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 517c0e9f23e..abfaaad08f0 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -33,6 +33,7 @@ keep=false
prefix=
dejagnu=no
timeout=60
+testname=""
while $loop; do
case "x$1" in
x--srcdir)
@@ -93,6 +94,15 @@ while $loop; do
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 @@ xyes)
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 --git a/libgo/testsuite/libgo.testmain/testmain.exp b/libgo/testsuite/libgo.testmain/testmain.exp
index f201de7f76a..0b887ac3efd 100644
--- a/libgo/testsuite/libgo.testmain/testmain.exp
+++ b/libgo/testsuite/libgo.testmain/testmain.exp
@@ -57,4 +57,10 @@ if ![ string match "" $comp_output ] {
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