Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventParser ¶
func EventParser(h ...Handler) io.WriteCloser
EventParser returns a Writer that parses events and hands each event to all handlers h.
Types ¶
type Handler ¶
type Handler interface {
Handle(e TestEvent)
}
Handler is a callback for TestEvent events.
type TestCollector ¶
type TestCollector struct {
// Package collects all output for a particular package.
Packages map[string]string
// Tests are indexed by fully-qualified packageName.TestName strings.
Tests map[string]*TestResult
// contains filtered or unexported fields
}
func NewTestCollector ¶
func NewTestCollector() *TestCollector
NewTestCollector returns a Handler that collects test results.
func (*TestCollector) Handle ¶
func (tc *TestCollector) Handle(e TestEvent)
Handle implements Handler.
type TestEvent ¶
type TestEvent struct {
Time time.Time `json:",omitempty"`
Action Action
Package string `json:",omitempty"`
Test string `json:",omitempty"`
Elapsed float64 `json:",omitempty"`
Output string `json:",omitempty"`
}
TestEvent is an event generated by `test2json`.
type TestResult ¶
TestResult is an individual tests' outcome.
Click to show internal directories.
Click to hide internal directories.