From f0668e7c8cc2f26e16afa31dd43be774b1db65a5 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Tue, 24 Aug 2021 15:58:03 -0700 Subject: [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 Trust: Katie Hockman Run-TryBot: Jay Conrod Reviewed-by: Katie Hockman --- src/testing/testing.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/testing/testing.go') 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") -- cgit v1.3