go-testing-interface: github.com/mitchellh/go-testing-interface Index | Files

package testing

import "github.com/mitchellh/go-testing-interface"

Index

Package Files

testing_go19.go

type RuntimeT Uses

type RuntimeT struct {
    // contains filtered or unexported fields
}

RuntimeT implements T and can be instantiated and run at runtime to mimic *testing.T behavior. Unlike *testing.T, this will simply panic for calls to Fatal. For calls to Error, you'll have to check the errors list to determine whether to exit yourself.

func (*RuntimeT) Error Uses

func (t *RuntimeT) Error(args ...interface{})

func (*RuntimeT) Errorf Uses

func (t *RuntimeT) Errorf(format string, args ...interface{})

func (*RuntimeT) Fail Uses

func (t *RuntimeT) Fail()

func (*RuntimeT) FailNow Uses

func (t *RuntimeT) FailNow()

func (*RuntimeT) Failed Uses

func (t *RuntimeT) Failed() bool

func (*RuntimeT) Fatal Uses

func (t *RuntimeT) Fatal(args ...interface{})

func (*RuntimeT) Fatalf Uses

func (t *RuntimeT) Fatalf(format string, args ...interface{})

func (*RuntimeT) Helper Uses

func (t *RuntimeT) Helper()

func (*RuntimeT) Log Uses

func (t *RuntimeT) Log(args ...interface{})

func (*RuntimeT) Logf Uses

func (t *RuntimeT) Logf(format string, args ...interface{})

func (*RuntimeT) Name Uses

func (t *RuntimeT) Name() string

func (*RuntimeT) Skip Uses

func (t *RuntimeT) Skip(args ...interface{})

func (*RuntimeT) SkipNow Uses

func (t *RuntimeT) SkipNow()

func (*RuntimeT) Skipf Uses

func (t *RuntimeT) Skipf(format string, args ...interface{})

func (*RuntimeT) Skipped Uses

func (t *RuntimeT) Skipped() bool

type T Uses

type T interface {
    Error(args ...interface{})
    Errorf(format string, args ...interface{})
    Fail()
    FailNow()
    Failed() bool
    Fatal(args ...interface{})
    Fatalf(format string, args ...interface{})
    Log(args ...interface{})
    Logf(format string, args ...interface{})
    Name() string
    Skip(args ...interface{})
    SkipNow()
    Skipf(format string, args ...interface{})
    Skipped() bool
    Helper()
}

T is the interface that mimics the standard library *testing.T.

In unit tests you can just pass a *testing.T struct. At runtime, outside of tests, you can pass in a RuntimeT struct from this package.

Package testing imports 2 packages (graph) and is imported by 124 packages. Updated 2018-08-27. Refresh now. Tools for package owners.