Documentation
¶
Index ¶
- Constants
- func CurrentRunningTest() string
- func FullFunctionName(i interface{}) string
- func FunctionName(i interface{}) string
- func IsRunningTests() bool
- func SkipUnlessOS(t *testing.T, allowedOSs ...string)
- func Stack() []byte
- func WaitUntil(what string, waitTimeout time.Duration, fn func() bool, pause ...time.Duration) error
Constants ¶
View Source
const (
SkipUnlessOSIllegalInvocation = "SkipUnlessOS invoked with empty `allowedOss' array"
)
Variables ¶
This section is empty.
Functions ¶
func CurrentRunningTest ¶
func CurrentRunningTest() string
CurrentRunningTest obtains the name of the currently running unit test. Use this with care, if invoked from an `init()` function, it WILL panic.
For example, given the following Stack:
apiserver_test.go:74: ok apiserver_test.go:69: 424 apiserver_test.go:70: goroutine 7 [running]: gigawatt-common/apiserver.tj(0xc208058090) /Users/jay/go/src/gigawatt-common/apiserver/apiserver_test.go:69 +0x7a gigawatt-common/apiserver.Test_Jay(0xc208058090) /Users/jay/go/src/gigawatt-common/apiserver/apiserver_test.go:75 +0xf9 testing.tRunner(0xc208058090, 0x6de870) /usr/local/go/src/testing/testing.go:447 +0xbf created by testing.RunTests /usr/local/go/src/testing/testing.go:555 +0xa8b
CurrentRunningTest() will return the string "Test_Jay".
func FullFunctionName ¶
func FullFunctionName(i interface{}) string
func FunctionName ¶
func FunctionName(i interface{}) string
func IsRunningTests ¶
func IsRunningTests() bool
IsRunningTests returns true if a unit-test is being run right now.
func SkipUnlessOS ¶
SkipUnlessOS is a common facility for skipping a test when the OS doesn't match one or more values.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.