diff options
| author | Jay Conrod <jayconrod@google.com> | 2021-08-24 15:58:03 -0700 |
|---|---|---|
| committer | Jay Conrod <jayconrod@google.com> | 2021-09-01 22:11:17 +0000 |
| commit | f0668e7c8cc2f26e16afa31dd43be774b1db65a5 (patch) | |
| tree | a0501d7d666e9b9b158fa3e3f04c58e15758e112 /src/testing/testing.go | |
| parent | 37f5885f29068d869e161c4ee8ee17c3e1195cc8 (diff) | |
| download | go-f0668e7c8cc2f26e16afa31dd43be774b1db65a5.tar.xz | |
[dev.fuzz] cmd/go: stream output when fuzzing
Previously, 'go test' streamed output when there were no package
arguments or when benchmarking. This CL expands that to include
fuzzing to ensure that coordinator progress messages are printed.
This change tweaks tests and output a little bit: the output is
slightly different depending on whether it was streamed or buffered in
'go test'.
Fixes golang/go#47603
Change-Id: I387470062cf0620f5c7f214b6f54039c921912c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/344831
Trust: Jay Conrod <jayconrod@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
Diffstat (limited to 'src/testing/testing.go')
| -rw-r--r-- | src/testing/testing.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go index 4bf5685a07..7f78a7caf8 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -1618,9 +1618,13 @@ func (m *M) Run() (code int) { } } - fuzzingRan, fuzzingOk := runFuzzing(m.deps, m.fuzzTargets) + fuzzingRan, fuzzingMatched, fuzzingOk := runFuzzing(m.deps, m.fuzzTargets) if *matchFuzz != "" && !fuzzingRan { - fmt.Fprintln(os.Stderr, "testing: warning: no targets to fuzz") + if fuzzingMatched == 0 { + fmt.Fprintln(os.Stderr, "testing: warning: no targets to fuzz") + } else { + fmt.Fprintln(os.Stderr, "testing: warning: will not fuzz, -fuzz matches more than one target") + } } if !*isFuzzWorker && !fuzzingOk { fmt.Println("FAIL") |
