Documentation ¶
Overview ¶
Package gtr defines a standard test report format and provides convenience methods to create and convert reports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPackageCoverageIsTooLow = errors.New("coverage is to low")
Functions ¶
func TrimPrefixSpaces ¶
TrimPrefixSpaces trims the leading whitespace of the given line using the indentation level of the test. Printing logs in a Go test is typically prepended by blocks of 4 spaces to align it with the rest of the test output. TrimPrefixSpaces intends to only trim the whitespace added by the Go test command, without inadvertently trimming whitespace added by the test author.
Types ¶
type Package ¶
type Package struct { Name string Timestamp time.Time Duration time.Duration Coverage float64 Output []string Properties []Property Tests []Test BuildError Error RunError Error }
Package contains build and test results for a single package.
func (*Package) AddProperty ¶
AddProperty appends a name/value property in the current package.
func (*Package) SetProperty ¶
SetProperty stores a key/value property in the current package. If a property with the given key already exists, its old value will be overwritten with the given value.
type Report ¶
type Report struct {
Packages []Package
}
Report contains the build and test results of a collection of packages.