]> Cypherpunks repositories - gostls13.git/commit
internal/coverage: fix bug in text-format coverage output with multiple packages
authorThan McIntosh <thanm@golang.org>
Tue, 12 Nov 2024 17:32:39 +0000 (12:32 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 28 Jan 2025 20:45:25 +0000 (12:45 -0800)
commit50455385b0e668656cac03d3012e48e071df6aa4
tree41045556e970706badd758cd9be0a400aa02179d
parent28d389ef30fc4c542a80603123990115035c6422
internal/coverage: fix bug in text-format coverage output with multiple packages

In ProcessCoverTestDir pass the selected set of packages to
EmitTextual in addition to EmitPercent, so that when we have runs with
multiple packages selected but without -coverpkg, text format output
for package P was incorrectly including output for P's covered
dependencies. This is in effect an extension of the fix for issue
65570.

Includes a cmd/go script test to verify correct behavior; ideally it
would be nice to locate this test in .../internal/coverage somewhere
but at the moment script tests are only supported for
cmd/{go,compile,link}.

Updates #65570.
Fixes #70244.

Change-Id: Ia0bb10155353aa0f2ead46e81a2aaa71bde4ef82
Reviewed-on: https://go-review.googlesource.com/c/go/+/627316
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Than McIntosh <thanm@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/testdata/script/cover_coverprofile_nocoverpkg.txt [new file with mode: 0644]
src/internal/coverage/cfile/testsupport.go