File: fuzz.sh

package info (click to toggle)
golang-github-gomarkdown-markdown 0.0~git20231115.a660076-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,168 kB
  • sloc: sh: 26; makefile: 5
file content (20 lines) | stat: -rwxr-xr-x 639 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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