cover

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Key = "mad_coverage_stats"
)

Variables

This section is empty.

Functions

func Calc

func Calc(profiles []Profile) float64

Calc returns the code covearge for the given profiles. We just take the total number of profile blocks with Count >0 divide by the total number of profile blocks.

func FormatLine

func FormatLine(out io.Writer, mode string, profiles []Profile) error

FormatLine will write the same output as go test -cover does to the out writer.

func JSON

func JSON() string

JSON marshals current coverage state to json string.

func Register

func Register(packageName string, coverFunc Handler)

Types

type Handler

type Handler func() []Profile

Handler is a function which returns the package profiles.

type Profile

type Profile struct {
	FileName string
	Mode     string
	Blocks   []ProfileBlock
}

func File

func File(fileName, mode string, counter []uint32, pos []uint32, numStmts []uint16) Profile

type ProfileBlock

type ProfileBlock struct {
	StartLine, StartCol int
	EndLine, EndCol     int
	NumStmt, Count      int
}

Jump to

Keyboard shortcuts

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