diff options
author | Russ Cox <rsc@golang.org> | 2015-12-17 00:52:33 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-12-17 16:59:30 +0000 |
commit | 0a0f8bae2747191cbc6cda61c1d5ef9512beded8 (patch) | |
tree | bab88cd26f39f8d1b7f904e6913ac7751c1edbe1 | |
parent | 7688f0d9fb13a77113f75f3b85ae7973cabc7044 (diff) | |
download | go-0a0f8bae2747191cbc6cda61c1d5ef9512beded8.tar.gz go-0a0f8bae2747191cbc6cda61c1d5ef9512beded8.zip |
cmd/go: document that -p applies to test binary execution
Fixes #11521.
Change-Id: I73615b881df4a0d5e2f5bc5059359d150ca8c105
Reviewed-on: https://go-review.googlesource.com/17946
Reviewed-by: Joe Shaw <joe@joeshaw.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/cmd/go/alldocs.go | 7 | ||||
-rw-r--r-- | src/cmd/go/build.go | 3 | ||||
-rw-r--r-- | src/cmd/go/test.go | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 8053b862d1..4487b7442e 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -84,7 +84,8 @@ and test commands: -n print the commands but do not run them. -p n - the number of builds that can be run in parallel. + the number of programs, such as build commands or + test binaries, that can be run in parallel. The default is the number of CPUs available, except on darwin/arm which defaults to 1. -race @@ -1420,6 +1421,10 @@ control the execution of any test: Allow parallel execution of test functions that call t.Parallel. The value of this flag is the maximum number of tests to run simultaneously; by default, it is set to the value of GOMAXPROCS. + Note that -parallel only applies within a single test binary. + The 'go test' command may run tests for different packages + in parallel as well, according to the setting of the -p flag + (see 'go help build'). -run regexp Run only those tests and examples matching the regular diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index dc1e61284e..82fd9833c0 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -63,7 +63,8 @@ and test commands: -n print the commands but do not run them. -p n - the number of builds that can be run in parallel. + the number of programs, such as build commands or + test binaries, that can be run in parallel. The default is the number of CPUs available, except on darwin/arm which defaults to 1. -race diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index acca304dfe..2010329365 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -207,6 +207,10 @@ const testFlag2 = ` Allow parallel execution of test functions that call t.Parallel. The value of this flag is the maximum number of tests to run simultaneously; by default, it is set to the value of GOMAXPROCS. + Note that -parallel only applies within a single test binary. + The 'go test' command may run tests for different packages + in parallel as well, according to the setting of the -p flag + (see 'go help build'). -run regexp Run only those tests and examples matching the regular |