gollvm: set GOCACHE before invoking gotools tests
Set GOCACHE to insure that the various gotools tests
are running from a clean slate.
Change-Id: I6b5b2ef9ed26ae89b910fd0d52f4b6e990e1ae1e
Reviewed-on: https://go-review.googlesource.com/c/145020
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/gotools/gotestprogram.sh b/gotools/gotestprogram.sh
index 8ae5812..9ebf110 100644
--- a/gotools/gotestprogram.sh
+++ b/gotools/gotestprogram.sh
@@ -94,8 +94,9 @@
echo "can't change to $BINDIR"
exit 1
fi
-rm -rf $WORKDIR
-mkdir $WORKDIR
+CACHEDIR="${BINDIR}/${WORKDIR}-gocache"
+rm -rf $WORKDIR $CACHEDIR
+mkdir $WORKDIR $CACHEDIR
#
# Copy in files cited in 'COPYGODIRS'. Each item here is a tuple X:Y
# where X is a source directory containing Go files and Y is a destination
@@ -147,6 +148,7 @@
#
# More setup
#
+export GOCACHE=$CACHEDIR
export GCCGOTOOLDIR=${BINDIR}
export GO_TESTING_GOTOOLS=yes
export GCCGO=${GOC}