Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( FuzzInteresting = 1 FuzzNormal = 0 FuzzDiscard = -1 )
Fuzz constants for go-fuzz to use when returning from the Fuzz func
Functions ¶
func GetCrashersDir ¶
func GetWorkdir ¶
Types ¶
type Crasher ¶
Crasher represents a go-fuzz "crasher" (an input that crashed the respective
fuzz function), its corresponding output (panic message), and name (input hash).
func (*Crasher) Recover ¶
func (crasher *Crasher) Recover(recoverCb RecoverCallback)
Recover is intended to be deferred. It calls the recover callback with the
string representation of the recovered value in the event of a panic.
func (*Crasher) Test ¶
func (crasher *Crasher) Test(recoverCb RecoverCallback)
Test calls the crashers fuzz function its input and recovers from panics
with the passed recover callback.
type CrasherIterator ¶
type CrasherIterator struct {
// contains filtered or unexported fields
}
CrasherIterator is an iterator for go-fuzz "crashers" located in the
respective fuzz function's working directory.
func MustNewCrasherIterator ¶
func MustNewCrasherIterator(fuzzFunc FuzzFunc) *CrasherIterator
MustNewCrasherIterator returns an iterator for crashers but panics if an error occurs.
func NewCrasherItertor ¶
func NewCrasherItertor(fuzzFunc FuzzFunc) (*CrasherIterator, error)
NewCrasherIteratorFor returns an iterator for crashers that lazily loads their inputs and outputs.
func (*CrasherIterator) Next ¶
func (iter *CrasherIterator) Next() (next *Crasher, done bool, err error)
Next gets the next crasher and increments the iterator.
func (CrasherIterator) TestFailingLimit ¶
func (iter CrasherIterator) TestFailingLimit(t *testing.T, limit int) (_ *Crasher, panics int, total int)
TestFailingLimit tests each crasher's input against its respective fuzz
function until it sees `limit` failing inputs
type RecoverCallback ¶
type RecoverCallback func(panicMsg string)