Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMustBeDirectory = errors.New("Must be a directory")
View Source
var ErrMustBeFile = errors.New("Must be a file")
Functions ¶
Types ¶
type CoverProfile ¶
type CoverProfile struct { NumberStatements int OutputPath string PackagePath string Stderr io.Writer Stdout io.Writer Tests []string TestsBranches map[string][]string UniqueBranches map[string]int }
func NewCoverProfile ¶
func NewCoverProfile(codePath string) (*CoverProfile, error)
func (*CoverProfile) Cleanup ¶
func (c *CoverProfile) Cleanup() error
func (*CoverProfile) Generate ¶
func (c *CoverProfile) Generate() error
func (*CoverProfile) ListTests ¶
func (c *CoverProfile) ListTests() error
func (*CoverProfile) Parse ¶
func (c *CoverProfile) Parse() error
Parse reads all files from a directory with extension .coverprofile, parses it, and populate CoverProfile object Design tradeoff to get the total number of statements: 1. Parse one file just to sum the total statements 2. Recalculate total statements each iteration on the loop 3. Add a counter and an if to just calculate the total sum in the first iteration Current implementation is number 3
func (CoverProfile) String ¶
func (c CoverProfile) String() string
String prints out the deltacoverage percentage for each test
Click to show internal directories.
Click to hide internal directories.