go test emits a build-fail event for the test binary and then a fail event
for the package with FailedBuild, so the summary printed two FAIL lines and
two output blocks per build failure. The package fail event now reports the
compiler output; a build-fail never followed by one is still printed at the
end. Build output also skips the panic detection, so a compiler crash is
shown as compiler output instead of a test panic.
Build output events may carry several lines in one payload; buffering
them as one entry undercounted the caps and skipped the indentation of
continuation lines. Each payload is split into lines first.
A package compiled for several test binaries reports build events under
"pkg [a.test]" and "pkg [b.test]". Cutting the suffix off merged their
buffers, and the first build-fail printed and deleted both. The full
import path is now the key and the suffix is only dropped for display.
go test -json interleaves the streams of packages that run in parallel,
so a single panic flag let one package's goroutine dump swallow the
output of every other package until its own fail event. Keep the panic
head per package and clear it with that package's result.
A test that hangs before printing anything is now registered on its run
event, so the unfinished list names it. Output a package prints outside
any test, which is where compiler diagnostics of a failed build land,
was dropped; it is buffered and printed when the package fails,
including the build-fail event newer Go versions emit.