From: Michael Hudson-Doyle Date: Wed, 8 Jan 2014 04:53:16 +0000 (-0500) Subject: cmd/go: test: do not put object files where later steps will find them X-Git-Tag: go1.3beta1~1035 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7178c05d05f2372c0c2b027c16b5e904d4259f6e;p=gostls13.git cmd/go: test: do not put object files where later steps will find them When recompiling a package whose basename is the name of a standard package for testing with gccgo, a .o file with the basename of the package being tested was being placed in the _test/ directory where the compilation of the test binary then found it when looking for the standard library package. This change puts the object files in a separate directory. Fixes #6793 R=golang-codereviews, dave, gobot, rsc, iant CC=golang-codereviews https://golang.org/cl/27650045 --- diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index 06ac9d2062..dfd24d836c 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -711,7 +711,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action, if ptest != p { a := b.action(modeBuild, modeBuild, ptest) - a.objdir = testDir + string(filepath.Separator) + a.objdir = testDir + string(filepath.Separator) + "_obj_test" + string(filepath.Separator) a.objpkg = ptestObj a.target = ptestObj a.link = false @@ -719,7 +719,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action, if pxtest != nil { a := b.action(modeBuild, modeBuild, pxtest) - a.objdir = testDir + string(filepath.Separator) + a.objdir = testDir + string(filepath.Separator) + "_obj_xtest" + string(filepath.Separator) a.objpkg = buildToolchain.pkgpath(testDir, pxtest) a.target = a.objpkg }