cover

package
v0.0.0-...-115217d Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(fileList string) ([]byte, error)

Run executes `go test -cover ./...` and returns the raw result.

Types

type Config

type Config struct {
	Threshold float64 `toml:"threshold"`
}

Config holds settings for coverage and thresholds.

func Load

func Load(wd string) (*Config, error)

Load configuration values from files.

type Entry

type Entry struct {
	Coverage  float64
	Duration  string // TODO: parse this further into a time.Duration
	Path      string
	Status    string
	Threshold float64
}

Entry represents a per-path coverage measurement.

func Parse

func Parse(result []byte) []*Entry

Parse the stdout result from `go test -cover ./...`.

func (*Entry) Failed

func (e *Entry) Failed() bool

Failed checks if the threshold was not met.

func (*Entry) Passed

func (e *Entry) Passed() bool

Passed checks if the threshold was met.

func (*Entry) String

func (e *Entry) String() string

Jump to

Keyboard shortcuts

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