summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2022-11-30 12:04:59 -0500
committerThan McIntosh <thanm@google.com>2022-12-07 16:26:42 +0000
commitf715d28cea22de3a5752bdf019c1a00d4dcadf63 (patch)
treeaf9c4d48b38d17773b24d62be069e6b51ecdd3ad /doc
parent7ed50cfd09ba3d51c673fc782c6ad2b715a46bc2 (diff)
downloadgo-git-f715d28cea22de3a5752bdf019c1a00d4dcadf63.tar.gz
doc/go1.20: add section on coverage
Add some basic material on the changes to code coverage testing to the release notes. For #54202. Change-Id: I28200d43b4952ce8e8ecf46c8fe8e97c81d245e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/453857 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Eli Bendersky <eliben@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/go1.20.html29
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/go1.20.html b/doc/go1.20.html
index f53680e3ba..d14034c2f5 100644
--- a/doc/go1.20.html
+++ b/doc/go1.20.html
@@ -175,6 +175,14 @@ Do not send CLs removing the interior tags from such phrases.
Specifying <code>-pgo=off</code> turns off profile-guided optimization.
</p>
+<p><!-- https://go.dev/issue/51430 -->
+ The <code>go</code> <code>build</code>, <code>go</code> <code>install</code>,
+ and other build-related commands now support a <code>-cover</code>
+ flag that builds the specified target with code coverage instrumentation.
+ This is described in more detail in the
+ <a href="#cover">Cover</a> section below.
+</p>
+
<h4 id="go-version"><code>go</code> <code>version</code></h4>
<p><!-- https://go.dev/issue/48187 -->
@@ -228,7 +236,19 @@ Do not send CLs removing the interior tags from such phrases.
<h3 id="cover">Cover</h3>
<p><!-- CL 436236, CL 401236, CL 438503 -->
- TODO coverage
+ Go 1.20 supports collecting code coverage profiles for programs
+ (applications and integration tests), as opposed to just unit tests.
+</p>
+
+<p>
+ To collect coverage data for a program, build it with <code>go</code>
+ <code>build</code>'s <code>-cover</code> flag, then run the resulting
+ binary with the environment variable <code>GOCOVERDIR</code> set
+ to an output directory for coverage profiles.
+ See the
+ <a href="https://go.dev/testing/coverage">'coverage for integration tests' landing page</a> for more on how to get started.
+ For details on the design and implementation, see the
+ <a href="https://golang.org/issue/51430">proposal</a>.
</p>
<h3 id="vet">Vet</h3>
@@ -285,6 +305,13 @@ Do not send CLs removing the interior tags from such phrases.
assists in some circumstances.
</p>
+<p><!-- https://go.dev/issue/51430 -->
+ Go 1.20 adds a new <code>runtime/coverage</code> package
+ containing APIs for writing coverage profile data at
+ runtime from a long-running and/or server programs that
+ do not terminate via <code>os.Exit()</code>.
+</p>
+
<h2 id="compiler">Compiler</h2>
<p><!-- https://go.dev/issue/55022 -->