]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/testing/internal/testdeps/deps.go
testing: add available godoc link
[gostls13.git] / src / testing / internal / testdeps / deps.go
index b9c110100f2cb0acb8686207a2fb236a19334d0a..868307550eab60005dbbf915d231aadb46271d4b 100644 (file)
@@ -27,7 +27,7 @@ import (
 )
 
 // TestDeps is an implementation of the testing.testDeps interface,
-// suitable for passing to testing.MainStart.
+// suitable for passing to [testing.MainStart].
 type TestDeps struct{}
 
 var matchPat string
@@ -133,21 +133,32 @@ func (TestDeps) SetPanicOnExit0(v bool) {
        testlog.SetPanicOnExit0(v)
 }
 
-func (TestDeps) CoordinateFuzzing(timeout time.Duration, count int64, parallel int, seed []fuzz.CorpusEntry, types []reflect.Type, corpusDir, cacheDir string) (err error) {
+func (TestDeps) CoordinateFuzzing(
+       timeout time.Duration,
+       limit int64,
+       minimizeTimeout time.Duration,
+       minimizeLimit int64,
+       parallel int,
+       seed []fuzz.CorpusEntry,
+       types []reflect.Type,
+       corpusDir,
+       cacheDir string) (err error) {
        // Fuzzing may be interrupted with a timeout or if the user presses ^C.
        // In either case, we'll stop worker processes gracefully and save
        // crashers and interesting values.
        ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
        defer cancel()
        err = fuzz.CoordinateFuzzing(ctx, fuzz.CoordinateFuzzingOpts{
-               Log:       os.Stderr,
-               Timeout:   timeout,
-               Count:     count,
-               Parallel:  parallel,
-               Seed:      seed,
-               Types:     types,
-               CorpusDir: corpusDir,
-               CacheDir:  cacheDir,
+               Log:             os.Stderr,
+               Timeout:         timeout,
+               Limit:           limit,
+               MinimizeTimeout: minimizeTimeout,
+               MinimizeLimit:   minimizeLimit,
+               Parallel:        parallel,
+               Seed:            seed,
+               Types:           types,
+               CorpusDir:       corpusDir,
+               CacheDir:        cacheDir,
        })
        if err == ctx.Err() {
                return nil
@@ -174,3 +185,15 @@ func (TestDeps) RunFuzzWorker(fn func(fuzz.CorpusEntry) error) error {
 func (TestDeps) ReadCorpus(dir string, types []reflect.Type) ([]fuzz.CorpusEntry, error) {
        return fuzz.ReadCorpus(dir, types)
 }
+
+func (TestDeps) CheckCorpus(vals []any, types []reflect.Type) error {
+       return fuzz.CheckCorpus(vals, types)
+}
+
+func (TestDeps) ResetCoverage() {
+       fuzz.ResetCoverage()
+}
+
+func (TestDeps) SnapshotCoverage() {
+       fuzz.SnapshotCoverage()
+}