diff options
| author | Katie Hockman <katie@golang.org> | 2020-10-14 12:05:13 -0400 |
|---|---|---|
| committer | Filippo Valsorda <filippo@golang.org> | 2020-12-04 19:17:29 +0100 |
| commit | 24beae1df3e15c7d5b8d79ad2cfb4651c047e029 (patch) | |
| tree | cd9fb0572d05303b4b2064a41dabf5172899a16b /src/testing | |
| parent | 8fabdcee8ff0537097ae68619ff515563bb2f986 (diff) | |
| download | go-24beae1df3e15c7d5b8d79ad2cfb4651c047e029.tar.xz | |
[dev.fuzz] testing: remove testing.RunFuzzTargets
It is a legacy practice to expose these exported
testing functions, and is not needed for running
fuzz targets.
Change-Id: Ic300c9bfd15f4e71a1cea99f12c97d671a899f9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/262258
Trust: Katie Hockman <katie@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/fuzz.go | 7 | ||||
| -rw-r--r-- | src/testing/fuzz_test.go | 42 |
2 files changed, 0 insertions, 49 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go index 6773b7161d..766242f75d 100644 --- a/src/testing/fuzz.go +++ b/src/testing/fuzz.go @@ -256,13 +256,6 @@ type fuzzContext struct { runFuzzWorker func(func([]byte) error) error } -// RunFuzzTargets is an internal function but exported because it is cross-package; -// it is part of the implementation of the "go test" command. -func RunFuzzTargets(matchString func(pat, str string) (bool, error), fuzzTargets []InternalFuzzTarget) (ok bool) { - _, ok = runFuzzTargets(matchString, fuzzTargets) - return ok -} - // runFuzzTargets runs the fuzz targets matching the pattern for -run. This will // only run the f.Fuzz function for each seed corpus without using the fuzzing // engine to generate or mutate inputs. diff --git a/src/testing/fuzz_test.go b/src/testing/fuzz_test.go deleted file mode 100644 index 77a7d5ea4e..0000000000 --- a/src/testing/fuzz_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package testing_test - -import ( - "testing" -) - -func TestFuzzAdd(t *testing.T) { - matchFunc := func(a, b string) (bool, error) { return true, nil } - tests := []struct { - name string - fn func(f *testing.F) - ok bool - }{ - { - "empty", - func(f *testing.F) { f.Add() }, - false, - }, - { - "multiple arguments", - func(f *testing.F) { f.Add([]byte("hello"), []byte("bye")) }, - false, - }, - { - "string", - func(f *testing.F) { f.Add("hello") }, - false, - }, - { - "bytes", - func(f *testing.F) { f.Add([]byte("hello")) }, - true, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - if got, want := testing.RunFuzzTargets(matchFunc, []testing.InternalFuzzTarget{{Fn: tc.fn}}), tc.ok; got != want { - t.Errorf("testing.Add: ok %t, want %t", got, want) - } - }) - } -} |
