Commit 6d760fb0 authored by Russ Cox's avatar Russ Cox

cmd/go: document that testdata directories are ignored

Also rebuild doc.go; was stale, so contains extra changes.

Fixes #8677.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/148170043
parent ce143f25
...@@ -524,16 +524,23 @@ non-test installation. ...@@ -524,16 +524,23 @@ non-test installation.
In addition to the build flags, the flags handled by 'go test' itself are: In addition to the build flags, the flags handled by 'go test' itself are:
-c Compile the test binary to pkg.test but do not run it. -c
(Where pkg is the last element of the package's import path.) Compile the test binary to pkg.test but do not run it
(where pkg is the last element of the package's import path).
The file name can be changed with the -o flag.
-exec xprog
Run the test binary using xprog. The behavior is the same as
in 'go run'. See 'go help run' for details.
-i -i
Install packages that are dependencies of the test. Install packages that are dependencies of the test.
Do not run the test. Do not run the test.
-exec xprog -o file
Run the test binary using xprog. The behavior is the same as Compile the test binary to the named file.
in 'go run'. See 'go help run' for details. The test still runs (unless -c or -i is specified).
The test binary also accepts flags that control execution of the test; these The test binary also accepts flags that control execution of the test; these
flags are also accessible by 'go test'. See 'go help testflag' for details. flags are also accessible by 'go test'. See 'go help testflag' for details.
...@@ -910,7 +917,8 @@ single directory, the command is applied to a single synthesized ...@@ -910,7 +917,8 @@ single directory, the command is applied to a single synthesized
package made up of exactly those files, ignoring any build constraints package made up of exactly those files, ignoring any build constraints
in those files and ignoring any other files in the directory. in those files and ignoring any other files in the directory.
File names that begin with "." or "_" are ignored by the go tool. Directory and file names that begin with "." or "_" are ignored
by the go tool, as are directories named "testdata".
Description of testing flags Description of testing flags
...@@ -942,6 +950,7 @@ control the execution of any test: ...@@ -942,6 +950,7 @@ control the execution of any test:
-blockprofile block.out -blockprofile block.out
Write a goroutine blocking profile to the specified file Write a goroutine blocking profile to the specified file
when all tests are complete. when all tests are complete.
Writes test binary as -c would.
-blockprofilerate n -blockprofilerate n
Control the detail provided in goroutine blocking profiles by Control the detail provided in goroutine blocking profiles by
...@@ -973,8 +982,7 @@ control the execution of any test: ...@@ -973,8 +982,7 @@ control the execution of any test:
Sets -cover. Sets -cover.
-coverprofile cover.out -coverprofile cover.out
Write a coverage profile to the specified file after all tests Write a coverage profile to the file after all tests have passed.
have passed.
Sets -cover. Sets -cover.
-cpu 1,2,4 -cpu 1,2,4
...@@ -984,10 +992,11 @@ control the execution of any test: ...@@ -984,10 +992,11 @@ control the execution of any test:
-cpuprofile cpu.out -cpuprofile cpu.out
Write a CPU profile to the specified file before exiting. Write a CPU profile to the specified file before exiting.
Writes test binary as -c would.
-memprofile mem.out -memprofile mem.out
Write a memory profile to the specified file after all tests Write a memory profile to the file after all tests have passed.
have passed. Writes test binary as -c would.
-memprofilerate n -memprofilerate n
Enable more precise (and expensive) memory profiles by setting Enable more precise (and expensive) memory profiles by setting
......
...@@ -81,7 +81,8 @@ single directory, the command is applied to a single synthesized ...@@ -81,7 +81,8 @@ single directory, the command is applied to a single synthesized
package made up of exactly those files, ignoring any build constraints package made up of exactly those files, ignoring any build constraints
in those files and ignoring any other files in the directory. in those files and ignoring any other files in the directory.
File names that begin with "." or "_" are ignored by the go tool. Directory and file names that begin with "." or "_" are ignored
by the go tool, as are directories named "testdata".
`, `,
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment