1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:55:01 -07:00

testing: fix flag usage messages

Fixes #16404.

Change-Id: Iabaeeef3eff2fff6e5ed2d6bc9ef9c2f6d1cb5e7
Reviewed-on: https://go-review.googlesource.com/31332
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2016-10-17 23:30:38 -04:00
parent c999108723
commit 1188569534
2 changed files with 14 additions and 14 deletions

View File

@ -14,8 +14,8 @@ import (
"time" "time"
) )
var matchBenchmarks = flag.String("test.bench", "", "regular expression per path component to select benchmarks to run") var matchBenchmarks = flag.String("test.bench", "", "run only benchmarks matching `regexp`")
var benchTime = flag.Duration("test.benchtime", 1*time.Second, "approximate run time for each benchmark") var benchTime = flag.Duration("test.benchtime", 1*time.Second, "run each benchmark for duration `d`")
var benchmarkMemory = flag.Bool("test.benchmem", false, "print memory allocations for benchmarks") var benchmarkMemory = flag.Bool("test.benchmem", false, "print memory allocations for benchmarks")
// Global lock to ensure only one benchmark runs at a time. // Global lock to ensure only one benchmark runs at a time.

View File

@ -230,22 +230,22 @@ var (
// "go test", the binary always runs in the source directory for the package; // "go test", the binary always runs in the source directory for the package;
// this flag lets "go test" tell the binary to write the files in the directory where // this flag lets "go test" tell the binary to write the files in the directory where
// the "go test" command is run. // the "go test" command is run.
outputDir = flag.String("test.outputdir", "", "directory in which to write profiles") outputDir = flag.String("test.outputdir", "", "write profiles to `dir`")
// Report as tests are run; default is silent for success. // Report as tests are run; default is silent for success.
chatty = flag.Bool("test.v", false, "verbose: print additional output") chatty = flag.Bool("test.v", false, "verbose: print additional output")
count = flag.Uint("test.count", 1, "run tests and benchmarks `n` times") count = flag.Uint("test.count", 1, "run tests and benchmarks `n` times")
coverProfile = flag.String("test.coverprofile", "", "write a coverage profile to the named file after execution") coverProfile = flag.String("test.coverprofile", "", "write a coverage profile to `file`")
match = flag.String("test.run", "", "regular expression to select tests and examples to run") match = flag.String("test.run", "", "run only tests and examples matching `regexp`")
memProfile = flag.String("test.memprofile", "", "write a memory profile to the named file after execution") memProfile = flag.String("test.memprofile", "", "write a memory profile to `file`")
memProfileRate = flag.Int("test.memprofilerate", 0, "if >=0, sets runtime.MemProfileRate") memProfileRate = flag.Int("test.memprofilerate", 0, "set memory profiling `rate` (see runtime.MemProfileRate)")
cpuProfile = flag.String("test.cpuprofile", "", "write a cpu profile to the named file during execution") cpuProfile = flag.String("test.cpuprofile", "", "write a cpu profile to `file`")
blockProfile = flag.String("test.blockprofile", "", "write a goroutine blocking profile to the named file after execution") blockProfile = flag.String("test.blockprofile", "", "write a goroutine blocking profile to `file`")
blockProfileRate = flag.Int("test.blockprofilerate", 1, "if >= 0, calls runtime.SetBlockProfileRate()") blockProfileRate = flag.Int("test.blockprofilerate", 1, "set blocking profile `rate` (see runtime.SetBlockProfileRate)")
traceFile = flag.String("test.trace", "", "write an execution trace to the named file after execution") traceFile = flag.String("test.trace", "", "write an execution trace to `file`")
timeout = flag.Duration("test.timeout", 0, "if positive, sets an aggregate time limit for all tests") timeout = flag.Duration("test.timeout", 0, "fail test binary execution after duration `d` (0 means unlimited)")
cpuListStr = flag.String("test.cpu", "", "comma-separated list of number of CPUs to use for each test") cpuListStr = flag.String("test.cpu", "", "comma-separated `list` of cpu counts to run each test with")
parallel = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "maximum test parallelism") parallel = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "run at most `n` tests in parallel")
haveExamples bool // are there examples? haveExamples bool // are there examples?