From: Russ Cox Date: Thu, 17 Dec 2015 06:04:06 +0000 (-0500) Subject: cmd/go: document that tests run in the source directory X-Git-Tag: go1.6beta1~25 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f9137c5373932e38fc9431735134c9987e0d84c5;p=gostls13.git cmd/go: document that tests run in the source directory Fixes #13538. Change-Id: I621bbe2befe838d16d3664d7a5e30d5d7cceae33 Reviewed-on: https://go-review.googlesource.com/17949 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 96aed49ee2..a83f17ef35 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1486,6 +1486,11 @@ execution, not to the test itself.) The test flags that generate profiles (other than for coverage) also leave the test binary in pkg.test for use when analyzing the profiles. +When 'go test' runs a test binary, it does so from within the +corresponding package's source code directory. Depending on the test, +it may be necessary to do the same when invoking a generated test +binary directly. + The command-line package list, if present, must appear before any flag not known to the go test command. Continuing the example above, the package list would have to appear before -myflag, but could appear diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index 2010329365..995ba146f5 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -256,6 +256,11 @@ execution, not to the test itself.) The test flags that generate profiles (other than for coverage) also leave the test binary in pkg.test for use when analyzing the profiles. +When 'go test' runs a test binary, it does so from within the +corresponding package's source code directory. Depending on the test, +it may be necessary to do the same when invoking a generated test +binary directly. + The command-line package list, if present, must appear before any flag not known to the go test command. Continuing the example above, the package list would have to appear before -myflag, but could appear