covreport

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(w io.Writer, profiles map[string]string) error

Generate reads named coverage profiles and writes an HTML report. profiles maps profile names (e.g. "unit", "integration") to file paths.

func GenerateFromParsed

func GenerateFromParsed(w io.Writer, allProfiles map[string][]*cover.Profile) error

GenerateFromParsed generates a report from already-parsed profiles.

Types

type CoverageType

type CoverageType int

CoverageType identifies which test type(s) cover a block.

const (
	Uncovered CoverageType = iota
	Unit
	Integration
	Both
)

type DirChild

type DirChild struct {
	ID           string
	Name         string
	TotalStmts   int
	CoveredStmts int
	Pct          string
}

DirChild is one row in a directory summary table.

type DirReport

type DirReport struct {
	ID       string
	Name     string
	Children []DirChild
}

DirReport holds per-directory coverage summary.

type FileReport

type FileReport struct {
	ID       string // HTML-safe id
	Name     string // source file path
	TotalPct string // coverage percentage
	Lines    []LineCoverage
}

FileReport holds per-file coverage data for the report.

type LineCoverage

type LineCoverage struct {
	Class string        // CSS class
	Title string        // hover tooltip
	Text  template.HTML // syntax-highlighted HTML
}

LineCoverage holds the coverage info for a single source line.

type SummaryRow

type SummaryRow struct {
	Name         string
	TotalStmts   int
	CoveredStmts int
	Pct          string
}

SummaryRow holds one row of the summary table.

Jump to

Keyboard shortcuts

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