testctx

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, testingT *testing.T, suite any, middleware ...Middleware)

Types

type Middleware

type Middleware = func(*T) *T

func Combine

func Combine(middleware ...Middleware) Middleware

func WithOTelLogging

func WithOTelLogging(logger log.Logger) Middleware

func WithOTelTracing

func WithOTelTracing(tracer trace.Tracer) Middleware

type T

type T struct {
	*testing.T
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, t *testing.T) *T

func WithParallel

func WithParallel(t *T) *T

func (*T) BaseName

func (t *T) BaseName() string

func (*T) BeforeAll

func (t *T) BeforeAll(f func(*T) *T) *T

BeforeAll calls f immediately with itself and returns the result.

It is not inherited by subtests.

func (T) BeforeEach

func (t T) BeforeEach(f Middleware) *T

BeforeEach configures f to run prior to each subtest.

func (*T) Context

func (t *T) Context() context.Context

func (*T) Error

func (t *T) Error(vals ...any)

func (*T) Errorf

func (t *T) Errorf(format string, vals ...any)

func (*T) Errors

func (t *T) Errors() string

func (*T) Fatal

func (t *T) Fatal(vals ...any)

func (*T) Fatalf

func (t *T) Fatalf(format string, vals ...any)

func (*T) Log

func (t *T) Log(vals ...any)

func (*T) Logf

func (t *T) Logf(format string, vals ...any)

func (*T) Run

func (t *T) Run(name string, f func(context.Context, *T)) bool

func (*T) Skip

func (t *T) Skip(vals ...any)

func (*T) Skipf

func (t *T) Skipf(format string, vals ...any)

func (T) WithContext

func (t T) WithContext(ctx context.Context) *T

func (T) WithLogger

func (t T) WithLogger(logger func(*T, string)) *T

func (*T) WithTimeout

func (t *T) WithTimeout(timeout time.Duration) *T

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳