Documentation
¶
Overview ¶
Package test provides infrastructure for creating templated tests that may driven by the go test framework. A test implements Interface and comprises a set of named test vectors forming a Suite.
Index ¶
- Variables
- func RunGoTests(t *testing.T, dataroot string, fail FailCommands, packages []Package)
- type Array
- type FailCommands
- type Interface
- type Long
- type NopTeardown
- type Package
- func (p *Package) CheckPhase(phase int) error
- func (p *Package) LoadBaseline(path string) (Vector, error)
- func (p *Package) NumPhases() int
- func (p *Package) PostVector(phase int) (Vector, error)
- func (p *Package) PreVector() Vector
- func (p *Package) Run(phase, id int, params Params) error
- func (p *Package) RunVector(vector []Params, phase int) error
- func (p *Package) SaveBaseline(path string, v interface{}) error
- func (p *Package) SetupPhase(targetPhase int) error
- func (p *Package) UpdateBaseline() error
- type Params
- type Short
- type Suite
- type T
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadPhase = errors.New("phase number out of range")
Functions ¶
func RunGoTests ¶
func RunGoTests(t *testing.T, dataroot string, fail FailCommands, packages []Package)
Types ¶
type FailCommands ¶
type NopTeardown ¶
type NopTeardown struct{}
func (*NopTeardown) Teardown ¶
func (p *NopTeardown) Teardown(phase int) error
type Package ¶
type Package struct {
Name string
Test Interface
Phases int
// Baseline is nil for test packages that do not save their baseline
// to the file system. Otherwise, Baseline is a function that returns
// an blank vector that can be used with json.Unmarshal so we get
// proper type of json of objects instead of generic maps and arrays.
Baseline func() Vector
Dir string
Logger *zap.Logger
Terminal io.Writer
}
func (*Package) CheckPhase ¶
func (*Package) SaveBaseline ¶
func (*Package) SetupPhase ¶
func (*Package) UpdateBaseline ¶
Click to show internal directories.
Click to hide internal directories.