# TODO(jayconrod): support shared memory on more platforms.
[!darwin] [!linux] [!windows] skip
+# Test that running a fuzz target that returns without failing or calling
+# f.Fuzz fails and causes a non-zero exit status.
+# BUG(jayconrod): for now, it passes.
+go test noop_fuzz_test.go
+stdout ok
+! stdout FAIL
+
+# Test that fuzzing a fuzz target that returns without failing or calling
+# f.Fuzz fails and causes a non-zero exit status.
+# BUG(jayconrod): for now, it passes.
+go test -fuzz=Fuzz -fuzztime=5s -parallel=1 noop_fuzz_test.go
+stdout ok
+! stdout FAIL
+
# Test that calling f.Error in a fuzz target causes a non-zero exit status.
! go test -fuzz=Fuzz -fuzztime=5s -parallel=1 error_fuzz_test.go
! stdout ^ok
# Test that successful test exits cleanly.
go test success_fuzz_test.go
+stdout ^ok
+! stdout FAIL
+
+# Test that successful fuzzing exits cleanly.
+go test -fuzz=Fuzz -fuzztime=5s -parallel=1 success_fuzz_test.go
stdout ok
! stdout FAIL
! stdout ^ok
stdout FAIL
-# Test that successful fuzzing exits cleanly.
-go test -fuzz=Fuzz -fuzztime=5s -parallel=1 success_fuzz_test.go
-stdout ok
-! stdout FAIL
-
# Test error with seed corpus in f.Fuzz
! go test -run FuzzError fuzz_add_test.go
! stdout ^ok
! stdout FAIL
! stdout 'fatal here'
+-- noop_fuzz_test.go --
+package noop_fuzz
+
+import "testing"
+
+func Fuzz(f *testing.F) {}
+
-- error_fuzz_test.go --
package error_fuzz
import "testing"
func Fuzz(f *testing.F) {
+ f.Fuzz(func (*testing.T, []byte) {})
}
-- skipped_fuzz_test.go --
import "testing"
func Fuzz(f *testing.F) {
+ f.Fuzz(func (*testing.T, []byte) {})
}
-- multiple_fuzz_test.go --
import "testing"
func FuzzA(f *testing.F) {
+ f.Fuzz(func (*testing.T, []byte) {})
}
func FuzzB(f *testing.F) {
-}
\ No newline at end of file
+ f.Fuzz(func (*testing.T, []byte) {})
+}