testutil

package
v0.0.0-...-83e654d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockCtrl *gomock.Controller

MockCtrl is a gomock.Controller to use globally

Functions

func EnableDebugForMethod

func EnableDebugForMethod() func()

EnableDebugForMethod enables debug-level output through the current test Usage:

testutil.EnableDebugForMethod()()

func EnableInfoForMethod

func EnableInfoForMethod() func()

EnableInfoForMethod enables info-level output through the current test Usage:

testutil.EnableInfoForMethod()()

func ExpectDone

func ExpectDone(a *assert.Assertions, doneChannel chan bool)

ExpectDone waits to receive a value in the doneChannel for at least a second or fails the test.

func ExpectPanic

func ExpectPanic(t *testing.T)

ExpectPanic expects a panic (and fails if this does not happen).

func NewMockBenchmarkCtrl

func NewMockBenchmarkCtrl(b *testing.B) (*gomock.Controller, func())

func NewMockCtrl

func NewMockCtrl(t *testing.T) (*gomock.Controller, func())

NewMockCtrl initializes the `MockCtrl` package var and returns a method to finish the controller when test is complete **Important**: Don't forget to call the returned method at the end of the test Usage:

ctrl, finish := test_util.NewMockCtrl(t)
defer finish()

func PprofDebug

func PprofDebug()

func ResetDefaultRegistryHealthCheck

func ResetDefaultRegistryHealthCheck()

ResetDefaultRegistryHealthCheck resets the existing registry containing health-checks

func SkipIfDisabled

func SkipIfDisabled(t *testing.T)

SkipIfDisabled skips a test if the GO_TEST_DISABLED environment variable is set to any value (when `go test` runs)

func SkipIfShort

func SkipIfShort(t *testing.T)

SkipIfShort skips a test if the `-short` flag is given to `go test`

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL