1
.\" Hey, EMACS: -*- nroff -*-
2
.de Vb \" Begin verbatim text
7
.de Ve \" End verbatim text
11
.TH GO-TESTFLAG 7 "2012-05-13"
12
.\" Please adjust this date whenever revising the manpage.
14
go \- tool for managing Go source code
16
The 'go test' command takes both flags that apply to 'go test' itself
17
and flags that apply to the resulting test binary.
19
The test binary, called pkg.test, where pkg is the name of the
20
directory containing the package sources, has its own flags:
24
Verbose output: log all tests as they are run.
27
Run only those tests and examples matching the regular expression.
29
.B \-test.bench pattern
30
Run benchmarks matching the regular expression.
31
By default, no benchmarks run.
33
.B \-test.cpuprofile cpu.out
34
Write a CPU profile to the specified file before exiting.
36
.B \-test.memprofile mem.out
37
Write a memory profile to the specified file when all tests
40
.B \-test.memprofilerate n
41
Enable more precise (and expensive) memory profiles by setting
42
runtime.MemProfileRate. See 'godoc runtime MemProfileRate'.
43
To profile all memory allocations, use \-test.memprofilerate=1
44
and set the environment variable GOGC=off to disable the
45
garbage collector, provided the test can run in the available
46
memory without garbage collection.
49
Allow parallel execution of test functions that call t.Parallel.
50
The value of this flag is the maximum number of tests to run
51
simultaneously; by default, it is set to the value of GOMAXPROCS.
54
Tell long-running tests to shorten their run time.
55
It is off by default but set during all.bash so that installing
56
the Go tree can run a sanity check but not spend time running
60
If a test runs longer than t, panic.
63
Run enough iterations of each benchmark to take n seconds.
64
The default is 1 second.
67
Specify a list of GOMAXPROCS values for which the tests or
68
benchmarks should be executed. The default is the current value
71
For convenience, each of these \-test.X flags of the test binary is
72
also available as the flag \-X in 'go test' itself. Flags not listed
73
here are passed through unaltered. For instance, the command
76
\& go test \-x \-v \-cpuprofile=prof.out \-dir=testdata \-update
79
will compile the test binary and then run it as
82
\& pkg.test \-test.v \-test.cpuprofile=prof.out \-dir=testdata \-update
86
This manual page was written by Michael Stapelberg <stapelberg@debian.org>,
87
for the Debian project (and may be used by others).