cov

package
v0.0.0-...-63c2349 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateProfiles

func AggregateProfiles(profiles [][]*cover.Profile) ([]*cover.Profile, error)

AggregateProfiles takes multiple coverage profiles and produces a new coverage profile that counts the number of profiles that hit a block at least once.

func DiffProfiles

func DiffProfiles(before []*cover.Profile, after []*cover.Profile) ([]*cover.Profile, error)

DiffProfiles returns the difference between two sets of coverage profiles. The profiles are expected to be from a single execution of the same binary (or multiple binaries, if using a merged coverage profile)

func DumpProfile

func DumpProfile(profiles []*cover.Profile, writer io.Writer) error

DumpProfile dumps the profiles given to writer in go coverage format.

func FilterProfilePaths

func FilterProfilePaths(profile []*cover.Profile, paths []string, include bool) ([]*cover.Profile, error)

FilterProfilePaths produces a new profile that removes either everything matching or everything not matching the provided paths, depending on the value of include. Paths are interpreted as regular expressions. If include is true, paths is treated as an allowlist; otherwise it is treated as a denylist.

func MergeMultipleProfiles

func MergeMultipleProfiles(profiles [][]*cover.Profile) ([]*cover.Profile, error)

MergeMultipleProfiles merges more than two profiles together. MergeMultipleProfiles is equivalent to calling MergeProfiles on pairs of profiles until only one profile remains.

func MergeProfiles

func MergeProfiles(a []*cover.Profile, b []*cover.Profile) ([]*cover.Profile, error)

MergeProfiles merges two coverage profiles. The profiles are expected to be similar - that is, from multiple invocations of a single binary, or multiple binaries using the same codebase. In particular, any source files with the same path must have had identical content when building the binaries. MergeProfiles expects its arguments to be sorted: Profiles in alphabetical order, and lines in files in the order those lines appear. These are standard constraints for Go coverage profiles. The resulting profile will also obey these constraints.

Types

This section is empty.

Directories

Path Synopsis
calculation
Package calculation calculates coverage through summarizing and filtering.
Package calculation calculates coverage through summarizing and filtering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL