Documentation ¶
Index ¶
- Variables
- type ConsoleDriver
- func (d *ConsoleDriver) Error(field string, err error)
- func (d *ConsoleDriver) Fatal(field string, err error)
- func (d *ConsoleDriver) Info(field, value string)
- func (d *ConsoleDriver) Result(data string)
- func (d *ConsoleDriver) Run(name string, f func(Driver))
- func (d *ConsoleDriver) Warn(field, reason string)
- type Driver
- type Testable
Constants ¶
This section is empty.
Variables ¶
View Source
var NullDriver = &nullDriver{}
NullDriver does nothing, ignores all output and doesn't die on errors
Functions ¶
This section is empty.
Types ¶
type ConsoleDriver ¶
ConsoleDriver outputs test result to the given stdout/stderr descriptors
func NewConsoleDriver ¶
func NewConsoleDriver(stdout io.Writer) *ConsoleDriver
NewConsoleDriver initializes and returns a new console driver with output to given file
func NewConsoleDriverWithKiller ¶
func NewConsoleDriverWithKiller(stdout io.Writer, killer func()) *ConsoleDriver
NewConsoleDriverWithKiller initializes and returns a new console driver with output file Killer function will be called on fatal errors
func (*ConsoleDriver) Error ¶
func (d *ConsoleDriver) Error(field string, err error)
func (*ConsoleDriver) Fatal ¶
func (d *ConsoleDriver) Fatal(field string, err error)
func (*ConsoleDriver) Info ¶
func (d *ConsoleDriver) Info(field, value string)
func (*ConsoleDriver) Result ¶
func (d *ConsoleDriver) Result(data string)
func (*ConsoleDriver) Run ¶
func (d *ConsoleDriver) Run(name string, f func(Driver))
func (*ConsoleDriver) Warn ¶
func (d *ConsoleDriver) Warn(field, reason string)
type Driver ¶
type Driver interface { // Run tests under a given namespace Run(name string, f func(Driver)) // Info reports some value retrieved while testing to the user Info(field, value string) // Warn shows a warning to the user Warn(field string, reason string) // Error will report an error on the given field if err != nil, will report OK if not Error(field string, err error) // Fatal behaves like error but stops current goroutine on error Fatal(field string, err error) // Shows given result to the user Result(data string) }
Driver for testing, manages test flow and controls output
Click to show internal directories.
Click to hide internal directories.