testutil

package
v0.0.0-...-6e0b544 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisableDebugInfoVar = "DISABLE_DEBUG_INFO"
)

Variables

This section is empty.

Functions

func AddInitializer

func AddInitializer(initFunc InitializerFunc)

func Debug

func Debug(format string, args ...any)

func Debugf

func Debugf(format string, args ...any)

func Depth

func Depth(depth int) debugObj

func Info

func Info(format string, args ...any)

func Infof

func Infof(format string, args ...any)

func InitializeTest

func InitializeTest(c4t ContextForTests, test Test)

func SetDebugOutput

func SetDebugOutput(output bool)

func Warn

func Warn(format string, args ...any)

func Warnf

func Warnf(format string, args ...any)

Types

type Context

type Context = context.Context

type ContextForTestArgs

type ContextForTestArgs struct {
	T        *testing.T
	Context  context.Context
	Test     Test
	Common   *TestCommon
	Recorder *httptest.ResponseRecorder
}

type ContextForTests

type ContextForTests interface {
	context.Context
	testing.TB
	Depth() int
	IncrDepth() ContextForTests
	DecrDepth() ContextForTests
	Debugf(format string, args ...any) ContextForTests
	Debug(args ...any) ContextForTests
	SetTest(Test)
	Reset(*testing.T) ContextForTests
	SetTestingT(*testing.T)
	TestingT() *testing.T
	Run(string, func(t *testing.T)) bool
	SetContext(Context)
	Context() Context
	Test() Test
	Warnf(string, ...any) ContextForTests
	Warn(args ...any) ContextForTests
	Common() *TestCommon
	Update(ContextForTestArgs)
	Recorder() *httptest.ResponseRecorder
	ConfigFilepath() string
}

func NewContextForTests

func NewContextForTests(t *testing.T) ContextForTests

type InitializerFunc

type InitializerFunc func(ContextForTests)

type Test

type Test interface {
	Common() *TestCommon
}

type TestCommon

type TestCommon struct {
	Name   string
	Reason string
	Status int
	Output string
	LogOut []string
	T      *testing.T
}

func NewTestCommon

func NewTestCommon(c4t ContextForTests) *TestCommon

func (*TestCommon) Common

func (c *TestCommon) Common() *TestCommon

type TestSetter

type TestSetter interface {
	SetTest(Test)
}

Jump to

Keyboard shortcuts

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