testcoverage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrThresholdNotInRange         = fmt.Errorf("threshold must be in range [0 - 100]")
	ErrCoverageProfileNotSpecified = fmt.Errorf("coverage profile file not specified")
)

Functions

func Analyze

func Analyze(cfg Config, coverageStats []CoverageStats) bool

Types

type Config

type Config struct {
	Profile     string    `yaml:"profile"`
	LocalPrefix string    `yaml:"localPrefix"`
	Threshold   Threshold `yaml:"threshold"`
}

func ConfigFromFile

func ConfigFromFile(filename string) (*Config, error)

func NewConfig

func NewConfig() Config

func (Config) Validate

func (c Config) Validate() error

type CoverageStats

type CoverageStats struct {
	// contains filtered or unexported fields
}

func GenerateCoverageStats

func GenerateCoverageStats(profileFileName string) ([]CoverageStats, error)

func (*CoverageStats) CoveredPercentage

func (s *CoverageStats) CoveredPercentage() int

type FuncExtent

type FuncExtent struct {
	// contains filtered or unexported fields
}

FuncExtent describes a function's extent in the source by file and position.

type FuncVisitor

type FuncVisitor struct {
	// contains filtered or unexported fields
}

FuncVisitor implements the visitor that builds the function position list for a file.

func (*FuncVisitor) Visit

func (v *FuncVisitor) Visit(node ast.Node) ast.Visitor

Visit implements the ast.Visitor interface.

type Threshold

type Threshold struct {
	File    int `yaml:"file"`
	Package int `yaml:"package"`
	Total   int `yaml:"total"`
}

Jump to

Keyboard shortcuts

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