When building a native fuzzer with the -c flag, a unit test is built.
For example, I have a simple fuzzer:
package fuzz
import (
"fmt"
"testing"
)
func Fuzz(f *testing.F) {
f.Fuzz(func(t *testing.T, data string) {
fmt.Println(data)
})
}
I build it with go test -fuzz=Fuzz -c
...which gives me the fuzz.test executable.
Running that executable with ./fuzz.test prints out: PASS
This may be intended, but it would be highly desirable to offer support for building an executable that can be run with the same flags as go test -fuzz=Fuzz.
When building a native fuzzer with the
-cflag, a unit test is built.For example, I have a simple fuzzer:
I build it with
go test -fuzz=Fuzz -c...which gives me the
fuzz.testexecutable.Running that executable with
./fuzz.testprints out:PASSThis may be intended, but it would be highly desirable to offer support for building an executable that can be run with the same flags as
go test -fuzz=Fuzz.