]> Cypherpunks repositories - gostls13.git/commit
cmd/go,testing: re-implement testing.Coverage
authorThan McIntosh <thanm@google.com>
Fri, 12 May 2023 12:48:32 +0000 (08:48 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 23 May 2023 11:37:31 +0000 (11:37 +0000)
commitf81c885819cfca1b92ee64abb0b932e4f73b5049
tree7ac65460783a817fa76483e881c6051e7e41253c
parentc99d966c176a604b8ac2081fec0ecf9ab04b3745
cmd/go,testing: re-implement testing.Coverage

This patch revives the testing.Coverage() function, which takes a
snapshot of the coverage counters within an executing "go test -cover"
test binary and returns a percentage approximating the percent of
statements covered so far.

Fixes #59590.

Change-Id: I541d47a42d71c8fb2edc473d86c8951fa80f4ab0
Reviewed-on: https://go-review.googlesource.com/c/go/+/495450
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/load/test.go
src/cmd/go/testdata/script/testing_coverage.txt [new file with mode: 0644]
src/testing/cover.go
src/testing/newcover.go