aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-10-02 08:21:10 -0300
committerEuAndreh <eu@euandre.org>2024-10-02 08:33:47 -0300
commitc8f256f633d6e94839e95cafc0c18c22886bae01 (patch)
treed249e20eb5b05c1484899aa28773ce33ad2d8e12 /tests
parenttests/golite.go: Add explicit "deps" variable (diff)
downloadgolite-c8f256f633d6e94839e95cafc0c18c22886bae01.tar.gz
golite-c8f256f633d6e94839e95cafc0c18c22886bae01.tar.xz
Makefile: Add fuzz target setup
Diffstat (limited to 'tests')
-rw-r--r--tests/fuzz/api.go34
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())
+}