diff options
author | EuAndreh <eu@euandre.org> | 2024-10-02 08:21:10 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-10-02 08:33:47 -0300 |
commit | c8f256f633d6e94839e95cafc0c18c22886bae01 (patch) | |
tree | d249e20eb5b05c1484899aa28773ce33ad2d8e12 /tests | |
parent | tests/golite.go: Add explicit "deps" variable (diff) | |
download | golite-c8f256f633d6e94839e95cafc0c18c22886bae01.tar.gz golite-c8f256f633d6e94839e95cafc0c18c22886bae01.tar.xz |
Makefile: Add fuzz target setup
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fuzz/api.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/fuzz/api.go b/tests/fuzz/api.go new file mode 100644 index 0000000..50a19d2 --- /dev/null +++ b/tests/fuzz/api.go @@ -0,0 +1,34 @@ +package main + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func FuzzAPI(f *testing.F) { + f.Add(123) + f.Fuzz(func(t *testing.T, n int) { + // FIXME + if n == 1234 { + t.Errorf("Failed n: %q\n", n) + } + }) +} + + + +func main() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "FuzzAPI", FuzzAPI }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} |