Skip to content

Commit

Permalink
pkg/util/coverage: update fakeTestDeps impl
Browse files Browse the repository at this point in the history
testing.testDeps has had more methods added so fakeTestDeps needs to
follow suit
  • Loading branch information
spiffxp committed Aug 26, 2022
1 parent a0bd6dd commit cb98449
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions pkg/util/coverage/fake_test_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package coverage

import (
"io"
"reflect"
"time"
)

// This is an implementation of testing.testDeps. It doesn't need to do anything, because
Expand All @@ -27,6 +29,18 @@ import (
//nolint:unused // U1000 see comment above, we know it's unused normally.
type fakeTestDeps struct{}

// https://go.dev/src/testing/fuzz.go#L88
//
//nolint:unused // U1000 see comment above, we know it's unused normally.
type corpusEntry = struct {
Parent string
Path string
Data []byte
Values []any
Generation int
IsSeed bool
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) ImportPath() string {
return ""
Expand All @@ -37,6 +51,9 @@ func (fakeTestDeps) MatchString(pat, str string) (bool, error) {
return false, nil
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) SetPanicOnExit0(bool) {}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) StartCPUProfile(io.Writer) error {
return nil
Expand All @@ -62,3 +79,29 @@ func (fakeTestDeps) WriteHeapProfile(io.Writer) error {
func (fakeTestDeps) WriteProfileTo(string, io.Writer, int) error {
return nil
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) CoordinateFuzzing(time.Duration, int64, time.Duration, int64, int, []corpusEntry, []reflect.Type, string, string) error {
return nil
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) RunFuzzWorker(func(corpusEntry) error) error {
return nil
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) ReadCorpus(string, []reflect.Type) ([]corpusEntry, error) {
return nil, nil
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) CheckCorpus([]any, []reflect.Type) error {
return nil
}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) ResetCoverage() {}

//nolint:unused // U1000 see comment above, we know it's unused normally.
func (fakeTestDeps) SnapshotCoverage() {}

0 comments on commit cb98449

Please sign in to comment.