pkg

package
v0.0.0-...-2977300 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHtmlReport

func GenerateHtmlReport(out io.Writer) error

func GenerateHtmlReport2

func GenerateHtmlReport2(out io.Writer, coverageReportRawCodeDir string) error

func RegisterCover

func RegisterCover(fileName string, counter []uint32, pos []uint32, numStmts []uint16)

Types

type Boundary

type Boundary struct {
	Offset int     // Location as a byte offset in the source file.
	Start  bool    // Is this the start of a block?
	Count  int     // Event count from the cover profile.
	Norm   float64 // Count normalized to [0..1].
}

Boundary represents the position in a source file of the beginning or end of a block as reported by the coverage profile. In HTML mode, it will correspond to the opening or closing of a <span> tag and will be used to colorize the source

type Profile

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

Profile represents the profiling data for a specific file.

func ParseProfiles

func ParseProfiles(fileName string) ([]*Profile, error)

ParseProfiles parses profile data in the specified file and returns a Profile for each source file described therein.

func (*Profile) Boundaries

func (p *Profile) Boundaries(src []byte) (boundaries []Boundary)

Boundaries returns a Profile as a set of Boundary objects within the provided src.

type ProfileBlock

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

ProfileBlock represents a single block of profiling data.

Jump to

Keyboard shortcuts

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