diff options
author | Russ Cox <rsc@golang.org> | 2015-12-17 01:04:06 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-12-17 17:00:37 +0000 |
commit | f9137c5373932e38fc9431735134c9987e0d84c5 (patch) | |
tree | ea1f8441a92f3a137964d8e06ed524c64d649049 | |
parent | f474885f8a44d3c00e2f11315628fa80fda9404c (diff) | |
download | go-f9137c5373932e38fc9431735134c9987e0d84c5.tar.gz go-f9137c5373932e38fc9431735134c9987e0d84c5.zip |
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 <bradfitz@golang.org>
-rw-r--r-- | src/cmd/go/alldocs.go | 5 | ||||
-rw-r--r-- | src/cmd/go/test.go | 5 |
2 files changed, 10 insertions, 0 deletions
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 |