aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-12-17 01:04:06 -0500
committerRuss Cox <rsc@golang.org>2015-12-17 17:00:37 +0000
commitf9137c5373932e38fc9431735134c9987e0d84c5 (patch)
treeea1f8441a92f3a137964d8e06ed524c64d649049
parentf474885f8a44d3c00e2f11315628fa80fda9404c (diff)
downloadgo-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.go5
-rw-r--r--src/cmd/go/test.go5
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