Skip to content

Commit

Permalink
dog/go1.22: tweak coverage testing notes
Browse files Browse the repository at this point in the history
Clarify the section in the "go" command notes that deals with the
changes to "go test -cover" for packages without tests, adding a note
that if a package has not tests and no executable code, you still get
a "package has no test files" diagnostic.

Fixes #65262.

Change-Id: Ie960871f9d5c1a1965090738644eace28fc3e156
Reviewed-on: https://go-review.googlesource.com/c/go/+/561337
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chris Hines <chris.cs.guy@gmail.com>
  • Loading branch information
thanm committed Feb 6, 2024
1 parent 6f44cc8 commit 4b0e086
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions doc/go1.22.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ <h3 id="go-command">Go command</h3>

<!-- CL 495447 -->
<p>
<code>go</code> <code>test</code> <code>-cover</code> now prints coverage summaries for covered
packages that do not have their own test files. Prior to Go 1.22 a
<code>go</code> <code>test</code> <code>-cover</code> run for such a package would report
<code>go</code> <code>test</code> <code>-cover</code> now prints coverage summaries
for covered packages that do not have their own test files. Prior to Go 1.22 a
<code>go</code> <code>test</code> <code>-cover</code> run for such a package would
report
</p>

<p>
Expand All @@ -118,6 +119,13 @@ <h3 id="go-command">Go command</h3>
<code>mymod/mypack coverage: 0.0% of statements</code>
</p>

<p>
Note that if a package contains no executable code at all, we can't report
a meaningful coverage percentage; for such packages the <code>go</code> tool
will continue to report that there are no test files.
</p>


<h3 id="trace">Trace</h3>

<!-- https://go.dev/issue/63960 -->
Expand Down

0 comments on commit 4b0e086

Please sign in to comment.