From patchwork Tue Sep 12 13:18:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 812841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-461917-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="T1DZTMbT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xs5325y8Nz9s0g for ; Tue, 12 Sep 2017 23:18:37 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=ycDUQsGvfC6Svl8Mam6XOlmQKcqMFBLO/cOMSWWnU0gnU65NDw UdPfGXwWWlwR1nYEwh+vV9i2XmpWoA/91YQuvugsUfIlcFxA4iCkSwvei3zXs7Pa VAhtui8KguaDdikbAcXjqf6xkjQU6z3UjzTcJFaJJtJ0pCDT13Aia5A8s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=U4O+wSVtiZlJly1S5ID1OcAAfM4=; b=T1DZTMbTMVhbcMJfQndo RWax6+n5rOeTb5tCTbcuEL82PAz37p3yLpqsd9uJ7cSStZ9WYgM9w+h3yu6cdydJ plJOqkCpwF/ZTO1uVKe4pWGAL6atbsW5SRbKTMfXApV6R9s8SGurVmopY37hD2sE UkKpIh3CAYpAAxi//GVgb+k= Received: (qmail 116583 invoked by alias); 12 Sep 2017 13:18:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116566 invoked by uid 89); 12 Sep 2017 13:18:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=go, UD:v, tedious X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Sep 2017 13:18:26 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id BA1D7E08; Tue, 12 Sep 2017 15:18:23 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Oh8H7qicoQFR; Tue, 12 Sep 2017 15:18:19 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 2BAA3E07; Tue, 12 Sep 2017 15:18:19 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id v8CDII49005288; Tue, 12 Sep 2017 15:18:18 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: [gotools] Fix some gotools testing problems Date: Tue, 12 Sep 2017 15:18:18 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes A couple of gotools test FAIL on Solaris, and there are several issues that make investigation particularly tedious. * The one invocation of gotest doesn't support passing additional flags (--keep in particular). Added below. * The order of some of the summaries isn't stable (cmd/go and runtime, while cgo and carchive are, it seems). I'm now sorting the output by test name, both for make check output and the creation of gotools.sum. Otherwise, it's hard to compare mail-report.log between builds. * The freshly built go, cgo, and gofmt rely on LD_LIBRARY_PATH to be set so libgcc.so is found at runtime. The right value is passed in from the toplevel during a bootstrap, but missing when I run make check in gotools manually. * The most glaring problem is getting your hands on the failing executables: there are several levels of indirection here make -> gotest ... -> go build -> gccgo -> a.out -> go test Many of those steps also depend on lots of environment variables set to the check-gcc or check-gccgo wrapper scripts and it's hard to determine what's necessary to be able to lay my hand on the resulting executable to run it under gdb. I've found no way to pass e.g. -work to go build from the outside (e.g. via an environment variable), nor can I see the commands executed, so this means modifying the test sources or run the full testsuite under truss in the hope to determine all that's necessary to reproduce the build. Anyway, here's the trivial part so far. Ok for mainline? Rainer # HG changeset patch # Parent 6cf2b85bf501a5d54f0e0558b078b90b6d6ea0dc Fix some gotools testing problems diff --git a/gotools/Makefile.am b/gotools/Makefile.am --- a/gotools/Makefile.am +++ b/gotools/Makefile.am @@ -139,6 +139,8 @@ install-exec-local: cgo$(EXEEXT) uninstall-local: rm -f $(DESTDIR)$(libexecsubdir)/cgo$(exeext) +GOTESTFLAGS = + # Run tests using the go tool, and frob the output to look like that # generated by DejaGNU. The main output of this is two files: # gotools.sum and gotools.log. @@ -211,7 +213,7 @@ check-go-tool: go$(EXEEXT) cgo$(EXEEXT) GOPATH=`cd check-go-dir && $(PWD_COMMAND)`; \ export GOPATH; \ (cd check-go-dir/src/cmd/go && $(abs_builddir)/go$(EXEEXT) test -test.short -test.v) > cmd_go-testlog 2>&1 || true - grep '^--- ' cmd_go-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' + grep '^--- ' cmd_go-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2 # check-runtime runs `go test runtime` in our environment. # The runtime package is also tested as part of libgo, @@ -225,15 +227,15 @@ check-runtime: go$(EXEEXT) cgo$(EXEEXT) GOARCH=`$(abs_builddir)/go$(EXEEXT) env GOARCH`; \ GOOS=`$(abs_builddir)/go$(EXEEXT) env GOOS`; \ files=`$(SHELL) $(libgosrcdir)/../match.sh --goarch=$${GOARCH} --goos=$${GOOS} --srcdir=$(libgosrcdir)/runtime --extrafiles="$(libgodir)/runtime_sysinfo.go $(libgodir)/sigtab.go" --tag=libffi`; \ - echo "$(ECHO_ENV) GC='$(abs_builddir)/check-gccgo -fgo-compiling-runtime' GOARCH=$${GOARCH} GOOS=$${GOOS} $(SHELL) $(libgosrcdir)/../testsuite/gotest --goarch=$${GOARCH} --goos=$${GOOS} --basedir=$(libgosrcdir)/.. --srcdir=$(libgosrcdir)/runtime --pkgpath=runtime --pkgfiles='$${files}' -test.v" > runtime-testlog + echo "$(ECHO_ENV) GC='$(abs_builddir)/check-gccgo -fgo-compiling-runtime' GOARCH=$${GOARCH} GOOS=$${GOOS} $(SHELL) $(libgosrcdir)/../testsuite/gotest --goarch=$${GOARCH} --goos=$${GOOS} --basedir=$(libgosrcdir)/.. --srcdir=$(libgosrcdir)/runtime --pkgpath=runtime --pkgfiles='$${files}' $(GOTESTFLAGS) -test.v" > runtime-testlog $(CHECK_ENV) \ GC="$${GCCGO} -fgo-compiling-runtime"; \ export GC; \ GOARCH=`$(abs_builddir)/go$(EXEEXT) env GOARCH`; \ GOOS=`$(abs_builddir)/go$(EXEEXT) env GOOS`; \ files=`$(SHELL) $(libgosrcdir)/../match.sh --goarch=$${GOARCH} --goos=$${GOOS} --srcdir=$(libgosrcdir)/runtime --extrafiles="$(libgodir)/runtime_sysinfo.go $(libgodir)/sigtab.go" --tag=libffi`; \ - $(SHELL) $(libgosrcdir)/../testsuite/gotest --goarch=$${GOARCH} --goos=$${GOOS} --basedir=$(libgosrcdir)/.. --srcdir=$(libgosrcdir)/runtime --pkgpath=runtime --pkgfiles="$${files}" -test.v >> runtime-testlog 2>&1 || true - grep '^--- ' runtime-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' + $(SHELL) $(libgosrcdir)/../testsuite/gotest --goarch=$${GOARCH} --goos=$${GOOS} --basedir=$(libgosrcdir)/.. --srcdir=$(libgosrcdir)/runtime --pkgpath=runtime --pkgfiles="$${files}" $(GOTESTFLAGS) -test.v >> runtime-testlog 2>&1 || true + grep '^--- ' runtime-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2 # check-cgo-test runs `go test misc/cgo/test` in our environment. check-cgo-test: go$(EXEEXT) cgo$(EXEEXT) check-head check-gccgo check-gcc @@ -246,7 +248,7 @@ check-cgo-test: go$(EXEEXT) cgo$(EXEEXT) GOTRACEBACK=2; \ export GOTRACEBACK; \ (cd cgo-test-dir/misc/cgo/test && $(abs_builddir)/go$(EXEEXT) test -test.short -test.v) >> cgo-testlog 2>&1 || true - grep '^--- ' cgo-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' + grep '^--- ' cgo-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2 # check-carchive-test runs `go test misc/cgo/testcarchive/carchive_test.go` # in our environment. @@ -260,7 +262,7 @@ check-carchive-test: go$(EXEEXT) cgo$(EX LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \ export LIBRARY_PATH; \ (cd carchive-test-dir/misc/cgo/testcarchive && $(abs_builddir)/go$(EXEEXT) test -test.v carchive_test.go) >> carchive-testlog 2>&1 || true - grep '^--- ' carchive-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' + grep '^--- ' carchive-testlog | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' | sort -k 2 # The check targets runs the tests and assembles the output files. check: check-head check-go-tool check-runtime check-cgo-test check-carchive-test @@ -271,7 +273,7 @@ check: check-head check-go-tool check-ru echo "Running $${testname}" >> gotools.sum; \ echo "Running $${testname}" >> gotools.log; \ sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' < $${file} >> gotools.log; \ - grep '^--- ' $${file} | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' -e 's/SKIP/UNTESTED/' >> gotools.sum; \ + grep '^--- ' $${file} | sed -e 's/^--- \(.*\) ([^)]*)$$/\1/' -e 's/SKIP/UNTESTED/' | sort -k 2 >> gotools.sum; \ done @echo >> gotools.sum @echo " === gotools Summary ===" >> gotools.sum