gotools patch committed: Set GOROOT in tests

Ian Lance Taylor iant@golang.org
Sat Jul 15 17:50:00 GMT 2017


This patch to the gotools Makefile sets GOROOT while running tests.
Otherwise some of the tests that invoke the go tool may use an
installed go tool, if there is one, rather than the one that was just
built.  Bootstrapped and ran gotools tests on x86_64-pc-linux-gnu.
Committed to mainline.

Ian

2017-07-15  Ian Lance Taylor  <iant@golang.org>

* Makefile.am (CHECK_ENV): Set GOROOT.
(ECHO_ENV): Report setting GOROOT.
* Makefile.in: Rebuild.
-------------- next part --------------
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 250186)
+++ Makefile.am	(working copy)
@@ -174,11 +174,13 @@ CHECK_ENV = \
 	export GO_TESTING_GOTOOLS; \
 	abs_libgodir=`cd $(libgodir) && $(PWD_COMMAND)`; \
 	LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; \
-	export LD_LIBRARY_PATH;
+	export LD_LIBRARY_PATH; \
+	GOROOT=$${abs_libgodir}; \
+	export GOROOT;
 
 # ECHO_ENV is a variant of CHECK_ENV to put into a testlog file.
 # It assumes that abs_libgodir is set.
-ECHO_ENV = PATH=`echo $(abs_builddir):$${PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` GCCGO='$(abs_builddir)/check-gccgo' GCCGOTOOLDIR='$(abs_builddir)' GO_TESTING_GOTOOLS=yes LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`
+ECHO_ENV = PATH=`echo $(abs_builddir):$${PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` GCCGO='$(abs_builddir)/check-gccgo' GCCGOTOOLDIR='$(abs_builddir)' GO_TESTING_GOTOOLS=yes LD_LIBRARY_PATH=`echo $${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` GOROOT=`echo $${abs_libgodir}`
 
 # check-go-tools runs `go test cmd/go` in our environment.
 check-go-tool: go$(EXEEXT) cgo$(EXEEXT) check-head check-gccgo


More information about the Gcc-patches mailing list