Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(129)

Unified Diff: src/cmd/gotest/gotest

Issue 171044: Remove GOBIN in PATH dependency; don't assume cwd is $G... (Closed)
Patch Set: code review 171044: Remove GOBIN in PATH dependency; don't assume cwd is $G... Created 15 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/gc/mkbuiltin ('k') | src/cmd/make.bash » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/gotest/gotest
===================================================================
--- a/src/cmd/gotest/gotest
+++ b/src/cmd/gotest/gotest
@@ -14,6 +14,8 @@
export LC_ALL=C
export LC_CTYPE=C
+GOBIN="${GOBIN:-$HOME/bin}"
+
_GC=$GC # Make.$GOARCH will overwrite this
if [ ! -f [Mm]akefile ]; then
@@ -94,10 +96,10 @@
set -e
-gomake testpackage-clean
-gomake testpackage "GOTESTFILES=$gofiles"
+"$GOBIN"/gomake testpackage-clean
+"$GOBIN"/gomake testpackage "GOTESTFILES=$gofiles"
if $havex; then
- $GC -o $xofile $xgofiles
+ "$GOBIN"/$GC -o $xofile $xgofiles
fi
# They all compile; now generate the code to call them.
@@ -107,20 +109,20 @@
MAKEFLAGS=
MAKELEVEL=
-importpath=$(gomake -s importpath)
+importpath=$("$GOBIN"/gomake -s importpath)
{
# test functions are named TestFoo
# the grep -v eliminates methods and other special names
# that have multiple dots.
pattern='Test([^a-z].*)?'
- tests=$(6nm -s _test/$importpath.a $xofile | egrep ' T .*·'$pattern'$' | grep -v '·.*[.·]' | sed 's/.* //; s/·/./')
+ tests=$("$GOBIN"/6nm -s _test/$importpath.a $xofile | egrep ' T .*·'$pattern'$' | grep -v '·.*[.·]' | sed 's/.* //; s/·/./')
if [ "x$tests" = x ]; then
echo 'gotest: error: no tests matching '$pattern in _test/$importpath.a $xofile 1>&2
exit 2
fi
# benchmarks are named BenchmarkFoo.
pattern='Benchmark([^a-z].*)?'
- benchmarks=$(6nm -s _test/$importpath.a $xofile | egrep ' T .*·'$pattern'$' | grep -v '·.*[.·]' | sed 's/.* //; s/·/./')
+ benchmarks=$("$GOBIN"/6nm -s _test/$importpath.a $xofile | egrep ' T .*·'$pattern'$' | grep -v '·.*[.·]' | sed 's/.* //; s/·/./')
# package spec
echo 'package main'
@@ -159,6 +161,6 @@
echo '}'
}>_testmain.go
-$GC _testmain.go
-$GL _testmain.$O
+"$GOBIN"/$GC _testmain.go
+"$GOBIN"/$GL _testmain.$O
$E ./$O.out "$@"
« no previous file with comments | « src/cmd/gc/mkbuiltin ('k') | src/cmd/make.bash » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b