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 ¶
This section is empty.
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 ¶ added in v2.1.0
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 Property ¶ added in v2.1.0
type Property struct {
Name, Value string
}
Property is a name/value property.
type Report ¶
type Report struct {
Packages []Package
}
Report contains the build and test results of a collection of packages.
func (*Report) IsSuccessful ¶
IsSuccessful returns true if none of the packages in this report have build or runtime errors and all tests passed without failures or were skipped.