mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 08:38:23 +00:00
add script to automate fuzzing
This commit is contained in:
parent
9598d10343
commit
5a8bcf1386
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,3 +6,5 @@ _obj
|
|||||||
_test*
|
_test*
|
||||||
markdown
|
markdown
|
||||||
tags
|
tags
|
||||||
|
fuzz-workdir/
|
||||||
|
markdown-fuzz.zip
|
||||||
|
20
s/fuzz.sh
Executable file
20
s/fuzz.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -u -e -o pipefail
|
||||||
|
|
||||||
|
# This runs a go-fuzz as described in:
|
||||||
|
# https://medium.com/@dgryski/go-fuzz-github-com-arolek-ase-3c74d5a3150c
|
||||||
|
# https://github.com/dvyukov/go-fuzz
|
||||||
|
|
||||||
|
go get github.com/dvyukov/go-fuzz/go-fuzz
|
||||||
|
go get github.com/dvyukov/go-fuzz/go-fuzz-build
|
||||||
|
|
||||||
|
# this step is expensive, so re-use previous runs if possible
|
||||||
|
if [ ! -f ./markdown-fuzz.zip ]; then
|
||||||
|
mkdir -p fuzz-workdir/corpus
|
||||||
|
cp testdata/*.text fuzz-workdir/corpus
|
||||||
|
echo "running go-fuzz-build, might take a while..."
|
||||||
|
go-fuzz-build github.com/gomarkdown/markdown
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "running go-fuzz"
|
||||||
|
go-fuzz -bin=./markdown-fuzz.zip -workdir=fuzz-workdir
|
Loading…
x
Reference in New Issue
Block a user