testdeps

Imports

Imports #

"bufio"
"context"
"internal/fuzz"
"internal/testlog"
"io"
"os"
"os/signal"
"reflect"
"regexp"
"runtime/pprof"
"strings"
"sync"
"time"

Constants & Variables

Cover var #

Cover indicates whether coverage is enabled.

var Cover bool

CoverMarkProfileEmittedFunc var #

These variables below are set at runtime (via code in testmain) to point to the equivalent functions in package internal/coverage/cfile; doing things this way allows us to have tests import internal/coverage/cfile only when -cover is in effect (as opposed to importing for all tests).

var CoverMarkProfileEmittedFunc func(val bool)

CoverMode var #

var CoverMode string

CoverProcessTestDirFunc var #

These variables below are set at runtime (via code in testmain) to point to the equivalent functions in package internal/coverage/cfile; doing things this way allows us to have tests import internal/coverage/cfile only when -cover is in effect (as opposed to importing for all tests).

var CoverProcessTestDirFunc func(dir string, cfile string, cm string, cpkg string, w io.Writer, selpkgs []string) error

CoverSelectedPackages var #

var CoverSelectedPackages []string

CoverSnapshotFunc var #

These variables below are set at runtime (via code in testmain) to point to the equivalent functions in package internal/coverage/cfile; doing things this way allows us to have tests import internal/coverage/cfile only when -cover is in effect (as opposed to importing for all tests).

var CoverSnapshotFunc func() float64

Covered var #

var Covered string

ImportPath var #

ImportPath is the import path of the testing binary, set by the generated main function.

var ImportPath string

log var #

var log testLog

matchPat var #

var matchPat string

matchRe var #

var matchRe *regexp.Regexp

Structs

TestDeps struct #

TestDeps is an implementation of the testing.testDeps interface, suitable for passing to [testing.MainStart].

type TestDeps struct {

}

testLog struct #

testLog implements testlog.Interface, logging actions by package os.

type testLog struct {
mu sync.Mutex
w *bufio.Writer
set bool
}

Functions

Chdir method #

func (l *testLog) Chdir(name string)

CheckCorpus method #

func (TestDeps) CheckCorpus(vals []any, types []reflect.Type) error

CoordinateFuzzing method #

func (TestDeps) CoordinateFuzzing(timeout time.Duration, limit int64, minimizeTimeout time.Duration, minimizeLimit int64, parallel int, seed []fuzz.CorpusEntry, types []reflect.Type, corpusDir string, cacheDir string) (err error)

Getenv method #

func (l *testLog) Getenv(key string)

ImportPath method #

func (TestDeps) ImportPath() string

InitRuntimeCoverage method #

func (TestDeps) InitRuntimeCoverage() (mode string, tearDown func(string, string) (string, error), snapcov func() float64)

MatchString method #

func (TestDeps) MatchString(pat string, str string) (result bool, err error)

Open method #

func (l *testLog) Open(name string)

ReadCorpus method #

func (TestDeps) ReadCorpus(dir string, types []reflect.Type) ([]fuzz.CorpusEntry, error)

ResetCoverage method #

func (TestDeps) ResetCoverage()

RunFuzzWorker method #

func (TestDeps) RunFuzzWorker(fn func(fuzz.CorpusEntry) error) error

SetPanicOnExit0 method #

SetPanicOnExit0 tells the os package whether to panic on os.Exit(0).

func (TestDeps) SetPanicOnExit0(v bool)

SnapshotCoverage method #

func (TestDeps) SnapshotCoverage()

StartCPUProfile method #

func (TestDeps) StartCPUProfile(w io.Writer) error

StartTestLog method #

func (TestDeps) StartTestLog(w io.Writer)

Stat method #

func (l *testLog) Stat(name string)

StopCPUProfile method #

func (TestDeps) StopCPUProfile()

StopTestLog method #

func (TestDeps) StopTestLog() error

WriteProfileTo method #

func (TestDeps) WriteProfileTo(name string, w io.Writer, debug int) error

add method #

add adds the (op, name) pair to the test log.

func (l *testLog) add(op string, name string)

coverTearDown function #

func coverTearDown(coverprofile string, gocoverdir string) (string, error)

Generated with Arrow