diff options
author | Robert Hencke <robert.hencke@gmail.com> | 2014-05-09 12:19:00 -0400 |
---|---|---|
committer | Robert Hencke <robert.hencke@gmail.com> | 2014-05-09 12:19:00 -0400 |
commit | 0098aa8b97feb00ccd1b02b6c976cd4092d085d4 (patch) | |
tree | d316e7b9885cf8f370aad5901d0d103231049110 /src/cmd | |
parent | 43dbfbd1e03232428eb4b5dd288f786682123457 (diff) | |
download | go-0098aa8b97feb00ccd1b02b6c976cd4092d085d4.tar.gz |
cmd/go: mark regexp as dependency of testmain
Fixes issue 6844.
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://codereview.appspot.com/97840043
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd')
-rwxr-xr-x | src/cmd/go/test.bash | 17 | ||||
-rw-r--r-- | src/cmd/go/test.go | 3 | ||||
-rw-r--r-- | src/cmd/go/testdata/dep_test.go | 7 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/cmd/go/test.bash b/src/cmd/go/test.bash index b6da37bd3..1930c7385 100755 --- a/src/cmd/go/test.bash +++ b/src/cmd/go/test.bash @@ -708,12 +708,28 @@ if ./testgo test notest >/dev/null 2>&1; then fi unset GOPATH +<<<<<<< local +TEST 'Issue 6844: cmd/go: go test -a foo does not rebuild regexp' +if ! ./testgo test -x -a -c testdata/dep_test.go 2>deplist; then + echo "go test -x -a -c testdata/dep_test.go failed" + ok=false +elif ! grep -q regexp deplist; then + echo "go test -x -a -c testdata/dep_test.go did not rebuild regexp" +======= TEST list template can use context function if ! ./testgo list -f "GOARCH: {{context.GOARCH}}"; then echo unable to use context in list template +>>>>>>> other ok=false fi +<<<<<<< local +rm -f deplist +rm -f deps.test +======= +>>>>>>> other +<<<<<<< local +======= TEST build -i installs dependencies d=$(TMPDIR=/var/tmp mktemp -d -t testgoXXX) export GOPATH=$d @@ -748,6 +764,7 @@ fi rm -rf $d unset GOPATH +>>>>>>> other # clean up if $started; then stop; fi rm -rf testdata/bin testdata/bin1 diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index d206da8dc..2f96ae294 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -418,6 +418,7 @@ func runTest(cmd *Command, args []string) { var coverFiles []string coverFiles = append(coverFiles, p.GoFiles...) coverFiles = append(coverFiles, p.CgoFiles...) + coverFiles = append(coverFiles, p.TestGoFiles...) p.coverVars = declareCoverVars(p.ImportPath, coverFiles...) } } @@ -676,7 +677,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action, stk.push("testmain") for dep := range testMainDeps { if ptest.ImportPath != dep { - p1 := loadImport("testing", "", &stk, nil) + p1 := loadImport(dep, "", &stk, nil) if p1.Error != nil { return nil, nil, nil, p1.Error } diff --git a/src/cmd/go/testdata/dep_test.go b/src/cmd/go/testdata/dep_test.go new file mode 100644 index 000000000..0c53ac4f9 --- /dev/null +++ b/src/cmd/go/testdata/dep_test.go @@ -0,0 +1,7 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package deps + +import _ "testing" |