mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cover: add new "emit meta file" mode for packages without tests
Introduce a new mode of execution for instrumenting packages that have no test files. Instead of just skipping packages with no test files (during "go test -cover" runs), the go command will invoke cmd/cover on the package passing in an option in the config file indicating that it should emit a coverage meta-data file directly for the package (if the package has no functions, an empty file is emitted). Note that this CL doesn't actually wire up this functionality in the Go command, that will come in a later patch. Updates #27261. Updates #58770 Updates #24570. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Change-Id: I01e8a3edb62441698c7246596e4bacbd966591c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/495446 Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
0b07bbd2be
commit
e356aa656d
8 changed files with 220 additions and 94 deletions
|
|
@ -32,6 +32,13 @@ type CoverPkgConfig struct {
|
|||
// corresponding field in cmd/go's PackageInternal struct for more
|
||||
// info.
|
||||
Local bool
|
||||
|
||||
// EmitMetaFile if non-empty is the path to which the cover tool should
|
||||
// directly emit a coverage meta-data file for the package, if the
|
||||
// package has any functions in it. The go command will pass in a value
|
||||
// here if we've been asked to run "go test -cover" on a package that
|
||||
// doesn't have any *_test.go files.
|
||||
EmitMetaFile string
|
||||
}
|
||||
|
||||
// CoverFixupConfig contains annotations/notes generated by the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue