libgo: Set name of test when using DejaGNU tests.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 31 Mar 2011 23:03:20 +0000 (23:03 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 31 Mar 2011 23:03:20 +0000 (23:03 +0000)
From-SVN: r171805

libgo/Makefile.am
libgo/Makefile.in
libgo/testsuite/gotest
libgo/testsuite/libgo.testmain/testmain.exp

index 45365a18c92a741bd93b0864c298b6f68ee7a4f7..cf6975d2db93195084d12a2f98a59a1433d59144 100644 (file)
@@ -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)"; \
index d4184cab459d4193afb6423c27eaad8aa036392a..306b9e43d4329245c3ae52f6546cf5835f33aaae 100644 (file)
@@ -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)"; \
index 517c0e9f23e6d167293dedd6835a6b45c3b4a591..abfaaad08f06e38f11e66a2185637ae3aa846546 100755 (executable)
@@ -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
index f201de7f76abbf990f3d28717e6f992a3a5126b6..0b887ac3efdd7cfd3df94f40bb24db648410a51c 100644 (file)
@@ -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