Documentation ¶
Index ¶
- Constants
- Variables
- type BlockCoverage
- type BlockCoverages
- type Clover
- type CloverReport
- type CloverReportFile
- type CloverReportPackage
- type CloverReportProject
- type Cobertura
- type CoberturaReport
- type CoberturaReportPackage
- type CoberturaReportPackages
- type Coverage
- type DiffCoverage
- type DiffFileCoverage
- type DiffFileCoverages
- type FileCoverage
- type FileCoverages
- type Gocover
- type Lcov
- type LineCoverage
- type LineCoverages
- type PosCoverage
- type PosCoverages
- type Printer
- type Processor
- type Simplecov
- type SimplecovCoverage
- type SimplecovFileCoverage
- type SimplecovReport
- type Type
Constants ¶
View Source
const CloverDefaultPath = "coverage.xml"
View Source
const CoberturaDefaultPath = "coverage.xml"
View Source
const GocoverDefaultPath = "coverage.out"
Variables ¶
View Source
var LcovDefaultPath = []string{"coverage", "lcov.info"}
View Source
var SimplecovDefaultPath = []string{"coverage", ".resultset.json"}
Functions ¶
This section is empty.
Types ¶
type BlockCoverage ¶ added in v0.17.0
type BlockCoverages ¶ added in v0.17.0
type BlockCoverages []*BlockCoverage
func (BlockCoverages) MaxCount ¶ added in v0.31.0
func (bcs BlockCoverages) MaxCount() int
func (BlockCoverages) ToLineCoverages ¶ added in v0.31.0
func (bcs BlockCoverages) ToLineCoverages() LineCoverages
type CloverReport ¶
type CloverReport struct { XMLName xml.Name `xml:"coverage"` Generated string `xml:"generated,attr"` Project *CloverReportProject `xml:"project"` }
type CloverReportFile ¶
type CloverReportFile struct { XMLName xml.Name `xml:"file"` Name string `xml:"name,attr"` Metrics struct { Loc int `xml:"loc,attr"` Ncloc int `xml:"ncloc,attr"` Classes int `xml:"classes,attr"` Methods int `xml:"methods,attr"` Coveredmethods int `xml:"coveredmethods,attr"` Conditionals int `xml:"conditionals,attr"` Coveredconditionals int `xml:"coveredconditionals,attr"` Statements int `xml:"statements,attr"` Coveredstatements int `xml:"coveredstatements,attr"` Elements int `xml:"elements,attr"` Coveredelements int `xml:"coveredelements,attr"` } `xml:"metrics"` Class struct { Name string `xml:"name,attr"` Namespace string `xml:"namespace,attr"` Metrics struct { Complexity int `xml:"complexity,attr"` Methods int `xml:"methods,attr"` Coveredmethods int `xml:"coveredmethods,attr"` Conditionals int `xml:"conditionals,attr"` Coveredconditionals int `xml:"coveredconditionals,attr"` Statements int `xml:"statements,attr"` Coveredstatements int `xml:"coveredstatements,attr"` Elements int `xml:"elements,attr"` Coveredelements int `xml:"coveredelements,attr"` } `xml:"metrics"` } `xml:"class"` Line []struct { Num int `xml:"num,attr"` Type string `xml:"type,attr"` Name string `xml:"name,attr"` Visibility string `xml:"visibility,attr"` Complexity int `xml:"complexity,attr"` Crap float64 `xml:"crap,attr"` Count int `xml:"count,attr"` } `xml:"line"` }
type CloverReportPackage ¶ added in v0.27.1
type CloverReportPackage struct { XMLName xml.Name `xml:"package"` Name string `xml:"name,attr"` File []CloverReportFile `xml:"file"` }
type CloverReportProject ¶ added in v0.12.1
type CloverReportProject struct { Timestamp string `xml:"timestamp,attr"` File []CloverReportFile `xml:"file"` Package []CloverReportPackage `xml:"package"` Metrics struct { Files int `xml:"files,attr"` Loc int `xml:"loc,attr"` Ncloc int `xml:"ncloc,attr"` Classes int `xml:"classes,attr"` Methods int `xml:"methods,attr"` Coveredmethods int `xml:"coveredmethods,attr"` Conditionals int `xml:"conditionals,attr"` Coveredconditionals int `xml:"coveredconditionals,attr"` Statements int `xml:"statements,attr"` Coveredstatements int `xml:"coveredstatements,attr"` Elements int `xml:"elements,attr"` Coveredelements int `xml:"coveredelements,attr"` } `xml:"metrics"` }
type Cobertura ¶ added in v0.12.0
type Cobertura struct{}
func NewCobertura ¶ added in v0.12.0
func NewCobertura() *Cobertura
type CoberturaReport ¶ added in v0.12.0
type CoberturaReport struct { XMLName xml.Name `xml:"coverage"` Version string `xml:"version,attr"` Timestamp string `xml:"timestamp,attr"` LinesValid int `xml:"lines-valid,attr"` LinesCovered int `xml:"lines-covered,attr"` LineRate float64 `xml:"line-rate,attr"` BranchesCovered int `xml:"branches-covered,attr"` BranchesValid int `xml:"branches-valid,attr"` BranchRate float64 `xml:"branch-rate,attr"` Complexity int `xml:"complexity,attr"` Sources struct { Source []string `xml:"source"` } `xml:"sources"` Packages *CoberturaReportPackages `xml:"packages"` }
type CoberturaReportPackage ¶ added in v0.12.0
type CoberturaReportPackage struct { Name string `xml:"name,attr"` LineRate float64 `xml:"line-rate,attr"` BranchRate float64 `xml:"branch-rate,attr"` Complexity int `xml:"complexity,attr"` Classes struct { Class []struct { Filename string `xml:"filename,attr"` Complexity int `xml:"complexity,attr"` LineRate float64 `xml:"line-rate,attr"` BranchRate float64 `xml:"branch-rate,attr"` Methods struct { Method []struct { Name string `xml:"name,attr"` Signature string `xml:"signature,attr"` LineRate float64 `xml:"line-rate,attr"` BranchRate float64 `xml:"branch-rate,attr"` Lines struct { Line []struct { Number int `xml:"number,attr"` Hits int `xml:"hits,attr"` } `xml:"line"` } `xml:"lines"` } } `xml:"methods"` Lines struct { Line []struct { Number int `xml:"number,attr"` Hits int `xml:"hits,attr"` } `xml:"line"` } `xml:"lines"` } `xml:"class"` } `xml:"classes"` }
type CoberturaReportPackages ¶ added in v0.12.1
type CoberturaReportPackages struct {
Package []CoberturaReportPackage `xml:"package"`
}
type Coverage ¶
type Coverage struct { Type Type `json:"type"` Format string `json:"format"` Total int `json:"total"` Covered int `json:"covered"` Files FileCoverages `json:"files"` }
func (*Coverage) Compare ¶ added in v0.20.0
func (c *Coverage) Compare(c2 *Coverage) *DiffCoverage
func (*Coverage) DeleteBlockCoverages ¶ added in v0.31.0
func (c *Coverage) DeleteBlockCoverages()
type DiffCoverage ¶ added in v0.20.0
type DiffFileCoverage ¶ added in v0.20.0
type DiffFileCoverage struct { File string `json:"file"` A float64 `json:"a"` B float64 `json:"b"` Diff float64 `json:"diff"` FileCoverageA *FileCoverage `json:"-"` FileCoverageB *FileCoverage `json:"-"` }
type DiffFileCoverages ¶ added in v0.20.0
type DiffFileCoverages []*DiffFileCoverage
func (DiffFileCoverages) FuzzyFindByFile ¶ added in v0.20.0
func (dfcs DiffFileCoverages) FuzzyFindByFile(file string) (*DiffFileCoverage, error)
type FileCoverage ¶
type FileCoverage struct { File string `json:"file"` Total int `json:"total"` Covered int `json:"covered"` Blocks BlockCoverages `json:"blocks,omitempty"` // contains filtered or unexported fields }
func NewFileCoverage ¶
func NewFileCoverage(file string) *FileCoverage
func (*FileCoverage) FindBlocksByLine ¶ added in v0.17.0
func (fc *FileCoverage) FindBlocksByLine(n int) BlockCoverages
type FileCoverages ¶
type FileCoverages []*FileCoverage
func (FileCoverages) FindByFile ¶ added in v0.17.0
func (fcs FileCoverages) FindByFile(file string) (*FileCoverage, error)
func (FileCoverages) FuzzyFindByFile ¶ added in v0.17.0
func (fcs FileCoverages) FuzzyFindByFile(file string) (*FileCoverage, error)
func (FileCoverages) PathPrefix ¶ added in v0.21.0
func (fcs FileCoverages) PathPrefix() (string, error)
type LineCoverage ¶ added in v0.31.0
type LineCoverage struct { Line int Count int PosCoverages PosCoverages }
type LineCoverages ¶ added in v0.31.0
type LineCoverages []*LineCoverage
func (LineCoverages) Covered ¶ added in v0.33.2
func (lcs LineCoverages) Covered() int
func (LineCoverages) FindByLine ¶ added in v0.31.0
func (lcs LineCoverages) FindByLine(l int) (*LineCoverage, error)
func (LineCoverages) Total ¶ added in v0.33.2
func (lcs LineCoverages) Total() int
type PosCoverage ¶ added in v0.31.0
type PosCoverages ¶ added in v0.31.0
type PosCoverages []*PosCoverage
func (PosCoverages) FindCountByPos ¶ added in v0.31.0
func (ps PosCoverages) FindCountByPos(pos int) (int, error)
type Printer ¶ added in v0.17.0
type Printer struct {
// contains filtered or unexported fields
}
func NewPrinter ¶ added in v0.17.0
func NewPrinter(fc *FileCoverage) *Printer
type SimplecovCoverage ¶
type SimplecovCoverage struct {
Coverage map[string]SimplecovFileCoverage `json:"coverage"`
}
func (*SimplecovCoverage) UnmarshalJSON ¶ added in v0.33.0
func (c *SimplecovCoverage) UnmarshalJSON(data []byte) error
type SimplecovFileCoverage ¶
type SimplecovFileCoverage struct {
Lines []interface{} `json:"lines"`
}
type SimplecovReport ¶
type SimplecovReport map[string]SimplecovCoverage
Click to show internal directories.
Click to hide internal directories.