@@ -65,7 +65,7 @@ followed by detailed output for each failed package.
65
65
'Go test' recompiles each package along with any files with names matching
66
66
the file pattern "*_test.go".
67
67
These additional files can contain test functions, benchmark functions, fuzz
68
- targets and example functions. See 'go help testfunc' for more.
68
+ tests and example functions. See 'go help testfunc' for more.
69
69
Each listed package causes the execution of a separate test binary.
70
70
Files whose names begin with "_" (including "_test.go") or "." are ignored.
71
71
@@ -214,7 +214,7 @@ control the execution of any test:
214
214
Run each test, benchmark, and fuzz seed n times (default 1).
215
215
If -cpu is set, run n times for each GOMAXPROCS value.
216
216
Examples are always run once. -count does not apply to
217
- fuzz targets matched by -fuzz.
217
+ fuzz tests matched by -fuzz.
218
218
219
219
-cover
220
220
Enable coverage analysis.
@@ -242,20 +242,19 @@ control the execution of any test:
242
242
243
243
-cpu 1,2,4
244
244
Specify a list of GOMAXPROCS values for which the tests, benchmarks or
245
- fuzz targets should be executed. The default is the current value
246
- of GOMAXPROCS. -cpu does not apply to fuzz targets matched by -fuzz.
245
+ fuzz tests should be executed. The default is the current value
246
+ of GOMAXPROCS. -cpu does not apply to fuzz tests matched by -fuzz.
247
247
248
248
-failfast
249
249
Do not start new tests after the first test failure.
250
250
251
251
-fuzz regexp
252
- Run the fuzz target matching the regular expression. When specified,
252
+ Run the fuzz test matching the regular expression. When specified,
253
253
the command line argument must match exactly one package within the
254
- main module, and regexp must match exactly one fuzz target within
255
- that package. After tests, benchmarks, seed corpora of other fuzz
256
- targets, and examples have completed, the matching target will be
257
- fuzzed. See the Fuzzing section of the testing package documentation
258
- for details.
254
+ main module, and regexp must match exactly one fuzz test within
255
+ that package. Fuzzing will occur after tests, benchmarks, seed corpora
256
+ of other fuzz tests, and examples have completed. See the Fuzzing
257
+ section of the testing package documentation for details.
259
258
260
259
-fuzztime t
261
260
Run enough iterations of the fuzz test to take t, specified as a
@@ -269,14 +268,14 @@ control the execution of any test:
269
268
same information as the -v flag in a machine-readable format.
270
269
271
270
-list regexp
272
- List tests, benchmarks, fuzz targets , or examples matching the regular
273
- expression. No tests, benchmarks, fuzz targets , or examples will be run.
271
+ List tests, benchmarks, fuzz tests , or examples matching the regular
272
+ expression. No tests, benchmarks, fuzz tests , or examples will be run.
274
273
This will only list top-level tests. No subtest or subbenchmarks will be
275
274
shown.
276
275
277
276
-parallel n
278
277
Allow parallel execution of test functions that call t.Parallel, and
279
- f.Fuzz functions that call t.Parallel when running the seed corpus.
278
+ fuzz targets that call t.Parallel when running the seed corpus.
280
279
The value of this flag is the maximum number of tests to run
281
280
simultaneously.
282
281
While fuzzing, the value of this flag is the maximum number of
@@ -291,7 +290,7 @@ control the execution of any test:
291
290
(see 'go help build').
292
291
293
292
-run regexp
294
- Run only those tests, examples, and fuzz targets matching the regular
293
+ Run only those tests, examples, and fuzz tests matching the regular
295
294
expression. For tests, the regular expression is split by unbracketed
296
295
slash (/) characters into a sequence of regular expressions, and each
297
296
part of a test's identifier must match the corresponding element in
@@ -468,7 +467,7 @@ A benchmark function is one named BenchmarkXxx and should have the signature,
468
467
469
468
func BenchmarkXxx(b *testing.B) { ... }
470
469
471
- A fuzz target is one named FuzzXxx and should have the signature,
470
+ A fuzz test is one named FuzzXxx and should have the signature,
472
471
473
472
func FuzzXxx(f *testing.F) { ... }
474
473
@@ -511,7 +510,7 @@ Here is another example where the ordering of the output is ignored:
511
510
512
511
The entire test file is presented as the example when it contains a single
513
512
example function, at least one other function, type, variable, or constant
514
- declaration, and no fuzz targets or test or benchmark functions .
513
+ declaration, and no tests, benchmarks, or fuzz tests .
515
514
516
515
See the documentation of the testing package for more information.
517
516
` ,
@@ -1196,8 +1195,8 @@ func declareCoverVars(p *load.Package, files ...string) map[string]*load.CoverVa
1196
1195
}
1197
1196
1198
1197
var noTestsToRun = []byte ("\n testing: warning: no tests to run\n " )
1199
- var noTargetsToFuzz = []byte ("\n testing: warning: no targets to fuzz\n " )
1200
- var tooManyTargetsToFuzz = []byte ("\n testing: warning: -fuzz matches more than one target , won't fuzz\n " )
1198
+ var noFuzzTestsToFuzz = []byte ("\n testing: warning: no fuzz tests to fuzz\n " )
1199
+ var tooManyFuzzTestsToFuzz = []byte ("\n testing: warning: -fuzz matches more than one fuzz test , won't fuzz\n " )
1201
1200
1202
1201
type runCache struct {
1203
1202
disableCache bool // cache should be disabled for this run
@@ -1399,11 +1398,11 @@ func (c *runCache) builderRunTest(b *work.Builder, ctx context.Context, a *work.
1399
1398
if bytes .HasPrefix (out , noTestsToRun [1 :]) || bytes .Contains (out , noTestsToRun ) {
1400
1399
norun = " [no tests to run]"
1401
1400
}
1402
- if bytes .HasPrefix (out , noTargetsToFuzz [1 :]) || bytes .Contains (out , noTargetsToFuzz ) {
1403
- norun = " [no targets to fuzz]"
1401
+ if bytes .HasPrefix (out , noFuzzTestsToFuzz [1 :]) || bytes .Contains (out , noFuzzTestsToFuzz ) {
1402
+ norun = " [no fuzz tests to fuzz]"
1404
1403
}
1405
- if bytes .HasPrefix (out , tooManyTargetsToFuzz [1 :]) || bytes .Contains (out , tooManyTargetsToFuzz ) {
1406
- norun = " [will not fuzz, -fuzz matches more than one target ]"
1404
+ if bytes .HasPrefix (out , tooManyFuzzTestsToFuzz [1 :]) || bytes .Contains (out , tooManyFuzzTestsToFuzz ) {
1405
+ norun = "[ -fuzz matches more than one fuzz test, won't fuzz ]"
1407
1406
}
1408
1407
if len (out ) > 0 && ! bytes .HasSuffix (out , []byte ("\n " )) {
1409
1408
// Ensure that the output ends with a newline before the "ok"
0 commit comments