Documentation ¶
Index ¶
- Variables
- func Init(m *testing.M)
- func PanicAllRunningTests(e interface{}, skip int)
- func PatchTestingLogger()
- func StartBenchmark(b *testing.B, pc uintptr, benchFunc func(b *testing.B))
- func UnpatchTestingLogger()
- type Benchmark
- type Option
- type Test
- func (test *Test) Context() context.Context
- func (test *Test) End()
- func (test *Test) Error(args ...interface{})
- func (test *Test) Errorf(format string, args ...interface{})
- func (test *Test) Fail()
- func (test *Test) FailNow()
- func (test *Test) Failed() bool
- func (test *Test) Fatal(args ...interface{})
- func (test *Test) Fatalf(format string, args ...interface{})
- func (test *Test) Helper()deprecated
- func (test *Test) Log(args ...interface{})
- func (test *Test) LogPanic(recoverData interface{}, skipFrames int)
- func (test *Test) Logf(format string, args ...interface{})
- func (test *Test) Name() string
- func (test *Test) Run(name string, f func(t *testing.T)) bool
- func (test *Test) SetTestCode(pc uintptr)
- func (test *Test) Skip(args ...interface{})
- func (test *Test) SkipNow()
- func (test *Test) Skipf(format string, args ...interface{})
- func (test *Test) Skipped() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TESTING_LOG_REGEX = regexp.MustCompile(`(?m)^ {4}(?P<file>[\w\/\.]+):(?P<line>\d+): (?P<message>(.*\n {8}.*)*.*)`)
)
Functions ¶
func PanicAllRunningTests ¶ added in v0.1.13
func PanicAllRunningTests(e interface{}, skip int)
Fails and write panic on running tests Use this only if the process is going to crash
func PatchTestingLogger ¶
func PatchTestingLogger()
func StartBenchmark ¶
Starts a new benchmark using a pc as caller
func UnpatchTestingLogger ¶
func UnpatchTestingLogger()
Types ¶
type Benchmark ¶
type Benchmark struct {
// contains filtered or unexported fields
}
func GetBenchmark ¶
Gets the Benchmark struct from *testing.Benchmark
type Test ¶
func StartTestFromCaller ¶
Starts a new test with and uses the caller pc info for Name and Suite
func (*Test) Helper
deprecated
func (test *Test) Helper()
Deprecated: use `testing.T.Helper` instead
func (*Test) LogPanic ¶ added in v0.1.13
Log panic data with stacktrace
func (*Test) Run ¶
Runs an auto instrumented sub test
Source Files ¶
Click to show internal directories.
Click to hide internal directories.