-
Notifications
You must be signed in to change notification settings - Fork 3
/
functions.go
31 lines (24 loc) · 1.3 KB
/
functions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package barrier
import (
"context"
)
// SetupSuiteFunction is the type of function that can be run from a suite setup.
// The returned data will be available to the main test function using TestInfo.SuiteSetupInfo() function.
// The returned function will be run at the end of the suite.
//
// If SetupSuiteFunction returns an error, the entire suite of test is stopped.
type SetupSuiteFunction func(context.Context, SuiteInfo) (interface{}, TearDownFunction, error)
// A TestFunction is the type of a function that is run by a Test.
type TestFunction func(context.Context, TestInfo) error
// SetupFunction is the type of function that can be run a a test setup.
// The returned data will be available to the main test function using TestInfo.SetupInfo() function.
// The returned function will be run at the end of the test.
//
// If SetupFunction returns an error, the entire suite of test is stopped.
type SetupFunction func(context.Context, TestInfo) (interface{}, TearDownFunction, error)
// A TearDownFunction is the type of function returned by a SetupFunction or SetupSuiteFunction.
type TearDownFunction func()
// Cleanup is a function type used for cleaning up.
type Cleanup func() error
// GenerateStash is a type of function that returns a generated stash.
type GenerateStash func(context.Context) interface{}