PR 56171 points out that the syscall/creds_test.go test fails on Solaris. In fact that test is only intended to be run on GNU/Linux anyhow. Solaris supports a similar mechanism, but it works differently. This patch changes the libgo Makefile to let packages specify the list of tests to run, and corrects the existing support in the gotest shell script to use that list correctly. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r a20ef2465f30 libgo/Makefile.am --- a/libgo/Makefile.am Sat Feb 02 07:10:22 2013 -0800 +++ b/libgo/Makefile.am Sat Feb 02 07:29:12 2013 -0800 @@ -1696,6 +1696,13 @@ syscall_utimesnano_file = go/syscall/libcall_posix_utimesnano.go endif +# Test files. +if LIBGO_IS_LINUX +syscall_creds_test_file = go/syscall/creds_test.go +else +syscall_creds_test_file = +endif + go_base_syscall_files = \ go/syscall/env_unix.go \ go/syscall/syscall_errno.go \ @@ -1734,6 +1741,10 @@ go/syscall/signame.c \ $(syscall_wait_c_file) +go_syscall_test_files = \ + $(syscall_creds_test_file) \ + go/syscall/passfd_test.go + libcalls.go: s-libcalls; @true s-libcalls: Makefile go/syscall/mksyscall.awk $(go_base_syscall_files) rm -f libcalls.go.tmp @@ -2005,9 +2016,9 @@ $(MKDIR_P) $(@D); \ rm -f $@-testsum $@-testlog; \ if test "$(use_dejagnu)" = "yes"; then \ - $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --testname="$(@D)" --goarch="$(GOARCH)" $(GOTESTFLAGS); \ + $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --testname="$(@D)" --goarch="$(GOARCH)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files); \ else \ - if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --goarch="$(GOARCH)" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \ + if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --goarch="$(GOARCH)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files) >>$@-testlog 2>&1; then \ echo "PASS: $(@D)" >> $@-testlog; \ echo "PASS: $(@D)"; \ echo "PASS: $(@D)" > $@-testsum; \ diff -r a20ef2465f30 libgo/testsuite/gotest --- a/libgo/testsuite/gotest Sat Feb 02 07:10:22 2013 -0800 +++ b/libgo/testsuite/gotest Sat Feb 02 07:29:12 2013 -0800 @@ -259,12 +259,20 @@ case "x$gofiles" in x) gofiles=`ls *_test.go 2>/dev/null` + ;; +*) + xgofiles=$gofiles + gofiles= + for f in $xgofiles; do + gofiles="$gofiles `basename $f`" + done esac case "x$gofiles" in x) echo 'no test files found' 1>&2 exit 1 + ;; esac # Run any commands given in sources, like @@ -295,6 +303,7 @@ # Split $gofiles into external gofiles (those in *_test packages) # and internal ones (those in the main package). +xgofiles= for f in $gofiles; do package=`grep '^package[ ]' $f | sed 1q` case "$package" in