testing

package
v0.0.0-...-2b5cbb2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocsPerRun

func AllocsPerRun(runs int, f func()) (avg float64)

func CoverMode

func CoverMode() string

func Coverage

func Coverage() float64

func Init

func Init()

func RegisterCover

func RegisterCover(c testing.Cover)

func RunExamples

func RunExamples(matchString func(pat, str string) (bool, error), examples []testing.InternalExample) (ok bool)

func RunTests

func RunTests(matchString func(pat, str string) (bool, error), tests []testing.InternalTest) (ok bool)

func Short

func Short() bool

func Verbose

func Verbose() bool

Types

type F

type F struct {
	Data     []byte
	T        *T
	FuzzFunc func(*T, any)
}

func (*F) Add

func (f *F) Add(args ...any)

func (*F) Cleanup

func (c *F) Cleanup(f func())

func (*F) CleanupTempDirs

func (f *F) CleanupTempDirs()

func (*F) Error

func (c *F) Error(args ...any)

func (*F) Errorf

func (c *F) Errorf(format string, args ...any)

func (*F) Fail

func (f *F) Fail()

func (*F) FailNow

func (c *F) FailNow()

func (*F) Failed

func (c *F) Failed() bool

func (*F) Fatal

func (c *F) Fatal(args ...any)

func (*F) Fatalf

func (c *F) Fatalf(format string, args ...any)

func (*F) Fuzz

func (f *F) Fuzz(ff any)

func (*F) Helper

func (f *F) Helper()

func (*F) Log

func (c *F) Log(args ...any)

func (*F) Logf

func (c *F) Logf(format string, args ...any)

func (*F) Name

func (c *F) Name() string

func (*F) Setenv

func (c *F) Setenv(key, value string)

func (*F) Skip

func (c *F) Skip(args ...any)

func (*F) SkipNow

func (c *F) SkipNow()

func (*F) Skipf

func (c *F) Skipf(format string, args ...any)

func (*F) Skipped

func (f *F) Skipped() bool

func (*F) TempDir

func (f *F) TempDir() string

type M

type M struct{}

func (*M) Run

func (m *M) Run() (code int)

type T

type T struct {
	TempDirs []string
}

T can be used to terminate the current fuzz iteration without terminating the whole fuzz run. To do so, simply panic with the text "GO-FUZZ-BUILD-PANIC" and the fuzzer will recover.

func NewT

func NewT() *T

func (*T) Cleanup

func (t *T) Cleanup(f func())

func (*T) CleanupTempDirs

func (t *T) CleanupTempDirs()

func (*T) Deadline

func (t *T) Deadline() (deadline time.Time, ok bool)

func (*T) Error

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

func (*T) Errorf

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

func (*T) Fail

func (t *T) Fail()

func (*T) FailNow

func (t *T) FailNow()

func (*T) Failed

func (t *T) Failed() bool

func (*T) Fatal

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

func (*T) Fatalf

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

func (*T) Helper

func (t *T) Helper()

func (*T) Log

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

func (*T) Logf

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

func (*T) Name

func (t *T) Name() string

func (*T) Parallel

func (t *T) Parallel()

func (*T) Run

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

func (*T) Setenv

func (t *T) Setenv(key, value string)

func (*T) Skip

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

func (*T) SkipNow

func (t *T) SkipNow()

func (*T) Skipf

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

Is not really supported. We just skip instead of printing any message. A log message can be added if need be.

func (*T) Skipped

func (t *T) Skipped() bool

func (*T) TempDir

func (t *T) TempDir() string

Jump to

Keyboard shortcuts

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