Skip to content

Instantly share code, notes, and snippets.

@dgryski
Created January 5, 2016 10:13
Show Gist options
  • Save dgryski/660e9bfaffe0150fbf0a to your computer and use it in GitHub Desktop.
Save dgryski/660e9bfaffe0150fbf0a to your computer and use it in GitHub Desktop.
package foo
import (
"io/ioutil"
"path/filepath"
"testing"
)
func TestFuzzCorpus(t *testing.T) {
corpus, err := filepath.Glob("workdir/corpus")
if err != nil {
t.Errorf("unable to glob: %v", err)
}
for _, f := range corpus {
data, err := ioutil.ReadFile(corpusFile)
if err != nil {
t.Errorf("error opening %s: %v", corpusFile, err)
continue
}
Fuzz(data)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment