Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncExtent ¶
type FuncExtent struct {
// contains filtered or unexported fields
}
FuncExtent describes a function's extent in the source by file and position.
type FuncVisitor ¶
type FuncVisitor struct {
// contains filtered or unexported fields
}
FuncVisitor implements the visitor that builds the function position list for a file.
type Function ¶
type Function struct { // Name is the name of the function. If the function has a receiver, the // name will be of the form T.N, where T is the type and N is the name. Name string `json:"name"` // File is the full path to the file in which the function is defined. File string `json:"file"` // Start is the start offset of the function's signature. Start int `json:"start"` // End is the end offset of the function. End int `json:"end"` // Coverage Coverage float64 `json:"coverage"` // TLOC TLOC int64 `json:"tloc"` // Statements registered with this function, JSON output omit statements (for now) Statements []*Statement `json:"-"` }
Function describes a function inner characteristics
func (*Function) Accumulate ¶
Accumulate will accumulate the coverage information from the provided Function into this Function.
type Package ¶
type Package struct { // Name is the package name Name string `json:"name"` // Path is the canonical path of the package. Path string `json:"path"` // Coverage Coverage float64 `json:"coverage"` // LOC contains the number of lines of code for a given package LOC int `json:"loc"` // Functions is a list of functions registered with this package. Functions []*Function `json:"-"` }
Package describes a package inner characteristics
func (*Package) Accumulate ¶
Accumulate will accumulate the coverage information from the provided Package into this Package.
type Report ¶
type Report struct { // Packages holds all tested packages Packages []*Package `json:"packages"` // Coverage Coverage float64 `json:"coverage"` }
Report contains information about tested packages, functions and statements
func ConvertRepository ¶
ConvertRepository converts a given repository to a Report struct
type Statement ¶
type Statement struct { // Start is the start offset of the statement. Start int `json:"start"` // End is the end offset of the statement. End int `json:"end"` // Reached is the number of times the statement was reached. Reached int64 `json:"-"` }
func (*Statement) Accumulate ¶
Accumulate will accumulate the coverage information from the provided Statement into this Statement.
type StmtExtent ¶
type StmtExtent extent
StmtExtent describes a statements's extent in the source by file and position.
type StmtVisitor ¶
type StmtVisitor struct {
// contains filtered or unexported fields
}
StmtVisitor implements a simple visitor for AST statements
func (*StmtVisitor) VisitStmt ¶
func (v *StmtVisitor) VisitStmt(s ast.Stmt)
VisitStmt lists all statements within a function