]> Cypherpunks repositories - gostls13.git/commit
runtime/coverage: add coverage snapshot helper routine
authorThan McIntosh <thanm@google.com>
Fri, 12 May 2023 12:20:08 +0000 (08:20 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 23 May 2023 11:37:04 +0000 (11:37 +0000)
commitef67022471bb26973168827ebf41e09f839fa0a7
tree1998bd5dfee920b3cf1d371fd59eacab700eadb3
parent380529d5c371ac036c757a155453f618465ee8d3
runtime/coverage: add coverage snapshot helper routine

Add a new function runtime/coverage.snapshot(), which samples the
current values of coverage counters in a running "go test -cover"
binary and returns percentage of statements executed so far. This
function is intended to be used by the function testing.Coverage().

Updates #59590.

Change-Id: I861393701c0cef47b4980aec14331168a9e64e8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/495449
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/coverage/testsupport.go
src/runtime/coverage/ts_test.go