]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.22] cmd/go: respect -coverpkg for unselected no-test packages
authorThan McIntosh <thanm@google.com>
Mon, 4 Mar 2024 15:52:56 +0000 (15:52 +0000)
committerThan McIntosh <thanm@google.com>
Thu, 21 Mar 2024 17:29:24 +0000 (17:29 +0000)
commit35b1a146d9febca70db87dc4e1f8bac33de857bb
tree60728c4334c1475b281ae0652f38ea1a909a8db4
parentdb6097f8cbaceaed02051850d2411c88b763a0c3
[release-branch.go1.22] cmd/go: respect -coverpkg for unselected no-test packages

This patch fixes a bug in the code that reports coverage percentages
and/or profiles for packages without tests. Specifically, the code
added as part of the fix for issue 24570 (in CL 495447) didn't
properly consider the -coverpkg selection and would look for the build
action meta-data file for a package that wasn't actually selected for
coverage.

Updates #65653.
Fixes #66137.

Change-Id: I66ffac11783c00a8cbd855fd05b9a90e4e0ed402
Reviewed-on: https://go-review.googlesource.com/c/go/+/568835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
(cherry picked from commit 2b22fc10459dff0fb4b3e5b08bc14ffb349aa4dd)
Reviewed-on: https://go-review.googlesource.com/c/go/+/569575
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/script/cover_coverpkg_partial.txt