Skip to content

Commit

Permalink
cmd/go: download test dependencies of all named packages
Browse files Browse the repository at this point in the history
Fixes #8181.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/123870043
  • Loading branch information
adg committed Aug 7, 2014
1 parent 750bf48 commit 10c2f56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmd/go/get.go
Expand Up @@ -151,7 +151,9 @@ func download(arg string, stk *importStack, getTestDeps bool) {
}

// Only process each package once.
if downloadCache[arg] {
// (Unless we're fetching test dependencies for this package,
// in which case we want to process it again.)
if downloadCache[arg] && !getTestDeps {
return
}
downloadCache[arg] = true
Expand Down
11 changes: 11 additions & 0 deletions src/cmd/go/test.bash
Expand Up @@ -543,6 +543,17 @@ TEST go get cover
unset GOPATH
rm -rf $d

TEST go get -t "code.google.com/p/go-get-issue-8181/{a,b}"
d=$(TMPDIR=/var/tmp mktemp -d -t testgoXXX)
export GOPATH=$d
if ./testgo get -t code.google.com/p/go-get-issue-8181/{a,b}; then
./testgo list ... | grep go.tools/godoc > /dev/null || ok=false
else
ok=false
fi
unset GOPATH
rm -rf $d

TEST shadowing logic
export GOPATH=$(pwd)/testdata/shadow/root1:$(pwd)/testdata/shadow/root2

Expand Down

0 comments on commit 10c2f56

Please sign in to comment.