Documentation ¶
Overview ¶
Package core provides a minimal core for organizing, executing and reporting of test cases nested in test groups.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the "C" of MVC (Model View Controller). In a test framework, all the test cases form a model (but unchangable by the controller), the test reporter is the view, and the controller controls the test running and send the test result to the test reporter.
func NewController ¶
func NewController(reporters ...ext.Reporter) *Controller
NewController creates and intialize a new Controller using r as the test reporter.
type DescFunc ¶
type DescFunc func(description string, f func())
DescFunc is the type of the function to define a test group with a descritpion and a closure.
type Path ¶
type Path []Serial
Path represents a path from the root to the leaf of nested test groups.
type S ¶
type S interface { Alias(name string) DescFunc // Define an alias of a DescFunc. Fail(err error) // Report a failure and continue test execution. FailNow(err error) // Report a failure and stop test execution immediately. // contains filtered or unexported methods }
S (short for "spec") provides the interface for writing tests and internally holds an object that contains minimal context needed to pass into a testing goroutine.