diff options
Diffstat (limited to 'src/testing/testing.go')
| -rw-r--r-- | src/testing/testing.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go index 60f0c23137..78ad8dbaac 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -1855,6 +1855,10 @@ func (f matchStringOnly) CheckCorpus([]any, []reflect.Type) error { return nil } func (f matchStringOnly) ResetCoverage() {} func (f matchStringOnly) SnapshotCoverage() {} +func (f matchStringOnly) InitRuntimeCoverage() (mode string, tearDown func(string, string) (string, error), snapcov func() float64) { + return +} + // Main is an internal function, part of the implementation of the "go test" command. // It was exported because it is cross-package and predates "internal" packages. // It is no longer used by "go test" but preserved, as much as possible, for other @@ -1902,12 +1906,14 @@ type testDeps interface { CheckCorpus([]any, []reflect.Type) error ResetCoverage() SnapshotCoverage() + InitRuntimeCoverage() (mode string, tearDown func(coverprofile string, gocoverdir string) (string, error), snapcov func() float64) } // MainStart is meant for use by tests generated by 'go test'. // It is not meant to be called directly and is not subject to the Go 1 compatibility document. // It may change signature from release to release. func MainStart(deps testDeps, tests []InternalTest, benchmarks []InternalBenchmark, fuzzTargets []InternalFuzzTarget, examples []InternalExample) *M { + registerCover2(deps.InitRuntimeCoverage()) Init() return &M{ deps: deps, |
