@@ -210,10 +210,10 @@ control the execution of any test:
210
210
(for example, -benchtime 100x).
211
211
212
212
-count n
213
- Run each test, benchmark, and fuzz targets' seed corpora n times
214
- (default 1).
213
+ Run each test, benchmark, and fuzz seed n times (default 1).
215
214
If -cpu is set, run n times for each GOMAXPROCS value.
216
- Examples are always run once.
215
+ Examples are always run once. -count does not apply to
216
+ fuzz targets matched by -fuzz.
217
217
218
218
-cover
219
219
Enable coverage analysis.
@@ -242,14 +242,18 @@ control the execution of any test:
242
242
-cpu 1,2,4
243
243
Specify a list of GOMAXPROCS values for which the tests, benchmarks or
244
244
fuzz targets should be executed. The default is the current value
245
- of GOMAXPROCS.
245
+ of GOMAXPROCS. -cpu does not apply to fuzz targets matched by -fuzz.
246
246
247
247
-failfast
248
248
Do not start new tests after the first test failure.
249
249
250
- -fuzz name
251
- Run the fuzz target with the given regexp. Must match exactly one fuzz
252
- target. This is an experimental feature.
250
+ -fuzz regexp
251
+ Run the fuzz target matching the regular expression. When specified,
252
+ the command line argument must match exactly one package, and regexp
253
+ must match exactly one fuzz target within that package. After tests,
254
+ benchmarks, seed corpora of other fuzz targets, and examples have
255
+ completed, the matching target will be fuzzed. See the Fuzzing section
256
+ of the testing package documentation for details.
253
257
254
258
-fuzztime t
255
259
Run enough iterations of the fuzz test to take t, specified as a
@@ -262,9 +266,6 @@ control the execution of any test:
262
266
Log verbose output and test results in JSON. This presents the
263
267
same information as the -v flag in a machine-readable format.
264
268
265
- -keepfuzzing
266
- Keep running the fuzz target if a crasher is found.
267
-
268
269
-list regexp
269
270
List tests, benchmarks, fuzz targets, or examples matching the regular
270
271
expression. No tests, benchmarks, fuzz targets, or examples will be run.
@@ -275,10 +276,13 @@ control the execution of any test:
275
276
Allow parallel execution of test functions that call t.Parallel, and
276
277
f.Fuzz functions that call t.Parallel when running the seed corpus.
277
278
The value of this flag is the maximum number of tests to run
278
- simultaneously. While fuzzing, the value of this flag is the
279
- maximum number of workers to run the fuzz function simultaneously,
280
- regardless of whether t.Parallel has been called; by default, it is set
281
- to the value of GOMAXPROCS.
279
+ simultaneously.
280
+ While fuzzing, the value of this flag is the maximum number of
281
+ subprocesses that may call the fuzz function simultaneously, regardless of
282
+ whether T.Parallel is called.
283
+ By default, -parallel is set to the value of GOMAXPROCS.
284
+ Setting -parallel to values higher than GOMAXPROCS may cause degraded
285
+ performance due to CPU contention, especially when fuzzing.
282
286
Note that -parallel only applies within a single test binary.
283
287
The 'go test' command may run tests for different packages
284
288
in parallel as well, according to the setting of the -p flag
@@ -507,28 +511,6 @@ See the documentation of the testing package for more information.
507
511
` ,
508
512
}
509
513
510
- var HelpFuzz = & base.Command {
511
- UsageLine : "fuzz" ,
512
- Short : "fuzzing" ,
513
- Long : `
514
- By default, go test will build and run the fuzz targets using the target's seed
515
- corpus only. Any generated corpora in $GOCACHE that were previously written by
516
- the fuzzing engine will not be run by default.
517
-
518
- When -fuzz is set, the binary will be instrumented for coverage. After all
519
- tests, examples, benchmark functions, and the seed corpora for all fuzz targets
520
- have been run, go test will begin to fuzz the specified fuzz target.
521
- Note that this feature is experimental.
522
-
523
- -run can be used for testing a single seed corpus entry for a fuzz target. The
524
- regular expression value of -run can be in the form $target/$name, where $target
525
- is the name of the fuzz target, and $name is the name of the file (ignoring file
526
- extensions) to run. For example, -run=FuzzFoo/497b6f87.
527
-
528
- See https://golang.org/s/draft-fuzzing-design for more details.
529
- ` ,
530
- }
531
-
532
514
var (
533
515
testBench string // -bench flag
534
516
testC bool // -c flag
0 commit comments