diff mbox

gotools patch committed: Set GOROOT in tests

Message ID CAOyqgcX_AYHZtMB3q+Oz6T2_zjD84zU9ZtR6_csyTdLtJny_7w@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor July 15, 2017, 5:50 p.m. UTC
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.
diff mbox

Patch

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