Documentation
¶
Index ¶
- Variables
- func Module(ctx diag.Context) module
- func Percent(c EachPather) float64
- func Report(c PathDetailer) string
- func ReportMD(c PathDetailer) string
- func ReportMDTo(w io.Writer, c PathDetailer)
- func ReportTo(w io.Writer, c PathDetailer)
- type BaseDetailer
- type ChangeDetailer
- type Counts
- type EachFiler
- type EachModuler
- type EachPackager
- type EachPather
- type EachStatementer
- type FileData
- func (fd FileData) Detail(path string) Counts
- func (fd FileData) EachFile(fn func(path string, count int, covered int))
- func (fd FileData) EachModule(fn func(path string, count int, covered int))
- func (fd FileData) EachPackage(fn func(path string, count int, covered int))
- func (fd FileData) EachPath(fn func(path string, count int, covered int))
- func (FileData) Grouping() Grouping
- func (fd FileData) Paths() []string
- type FileDelta
- type Grouping
- type ModuleData
- type ModuleDelta
- type PackageData
- type PackageDelta
- type PathData
- func (pd PathData) Detail(path string, agg bool) Counts
- func (pd PathData) EachModule(fn func(path string, count int, covered int))
- func (pd PathData) EachPackage(fn func(path string, count int, covered int))
- func (pd PathData) EachPath(fn func(path string, count int, covered int))
- func (pd PathData) Paths() []string
- type PathDelta
- type PathDetailer
- type RootData
- type RootDelta
- type StatementData
- func (sd StatementData) EachFile(fn func(path string, count int, covered int))
- func (sd StatementData) EachModule(fn func(path string, count int, covered int))
- func (sd StatementData) EachPackage(fn func(path string, count int, covered int))
- func (sd StatementData) EachStatement(fn func(path, pos string, count int, covered int))
- type StmtCount
- type StmtDelta
- type TestOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTestOptions = &TestOptions{ Flags: nil, Packages: []string{"."}, Excludes: nil, }
View Source
var ErrNoPackages = errors.New("no packages specified")
Functions ¶
func Percent ¶
func Percent(c EachPather) float64
func Report ¶
func Report(c PathDetailer) string
Report creates a multi-line report with details of each package's coverage on a line. If there is more than one package, a total package '.' will be added.
func ReportMD ¶
func ReportMD(c PathDetailer) string
ReportMD creates a multi-line report with details of each package's coverage on a line. If there is more than one package, a total package '.' will be added.
func ReportMDTo ¶
func ReportMDTo(w io.Writer, c PathDetailer)
ReportTo writes Report to a specified Writer.
func ReportTo ¶
func ReportTo(w io.Writer, c PathDetailer)
ReportTo writes Report to a specified Writer.
Types ¶
type BaseDetailer ¶
type ChangeDetailer ¶
type ChangeDetailer interface { PathDetailer BaseDetailer }
func Diff ¶
func Diff(log diag.Interface, old, new EachPather) ChangeDetailer
type EachModuler ¶
type EachPackager ¶
type EachPather ¶
type EachStatementer ¶
type FileData ¶
func CollectFiles ¶
func CollectFiles(ctx diag.Context, options *TestOptions) (FileData, error)
func (FileData) EachModule ¶
func (FileData) EachPackage ¶
type ModuleData ¶
type ModuleData struct{ PathData }
func ByModule ¶
func ByModule(log diag.Interface, pkgs EachPackager) ModuleData
func (ModuleData) Detail ¶
func (md ModuleData) Detail(p string) Counts
func (ModuleData) Grouping ¶
func (ModuleData) Grouping() Grouping
type ModuleDelta ¶
type ModuleDelta struct{ PathDelta }
func (ModuleDelta) BaseDetail ¶
func (md ModuleDelta) BaseDetail(p string) Counts
func (ModuleDelta) Detail ¶
func (md ModuleDelta) Detail(p string) Counts
func (ModuleDelta) Grouping ¶
func (ModuleDelta) Grouping() Grouping
type PackageData ¶
type PackageData struct{ PathData }
func (PackageData) Detail ¶
func (pd PackageData) Detail(p string) Counts
func (PackageData) Grouping ¶
func (PackageData) Grouping() Grouping
type PackageDelta ¶
type PackageDelta struct{ PathDelta }
func (PackageDelta) BaseDetail ¶
func (pd PackageDelta) BaseDetail(p string) Counts
func (PackageDelta) Detail ¶
func (pd PackageDelta) Detail(p string) Counts
func (PackageDelta) Grouping ¶
func (PackageDelta) Grouping() Grouping
type PathData ¶
func (PathData) EachModule ¶
func (PathData) EachPackage ¶
type PathDetailer ¶
type StatementData ¶
type StatementData map[stmt]bool // StatementData skips EachPath as EachStatement is not unique per file.
StatementData records all statements (including location data) and covered status
func CollectStatements ¶
func CollectStatements(ctx diag.Context, options *TestOptions) (StatementData, error)
func LoadProfile ¶
func LoadProfile(ctx diag.Context, prof string, options *TestOptions) (StatementData, error)
LoadProfile loads statement coverage from a coverprofile file.
func ReadProfile ¶
func ReadProfile(ctx diag.Context, r io.Reader, options *TestOptions) (StatementData, error)
ReadProfile loads statement coverage from a Reader.
func (StatementData) EachFile ¶
func (sd StatementData) EachFile(fn func(path string, count int, covered int))
func (StatementData) EachModule ¶
func (sd StatementData) EachModule(fn func(path string, count int, covered int))
func (StatementData) EachPackage ¶
func (sd StatementData) EachPackage(fn func(path string, count int, covered int))
func (StatementData) EachStatement ¶
func (sd StatementData) EachStatement(fn func(path, pos string, count int, covered int))
Click to show internal directories.
Click to hide internal directories.