Skip to content

Commit

Permalink
internal/tool/fuzz: allow script to pass arguments to go-fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnet committed Dec 30, 2016
1 parent 40ecc59 commit ca9a1d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/tool/fuzz/fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "${BASH_SOURCE[0]}")"

if [ $# != 1 ]; then
if [ $# == 0 ]; then
echo "Usage: $0 PKG"
echo
echo -e "Valid packages:\n\t$(ls -d */ | sed 's/\/*$//g' | tr '\n' ' ')"
Expand All @@ -26,9 +26,10 @@ fi

PKG=$(echo $1 | sed 's/\/*$//g')
PKG_PATH="github.com/dsnet/compress/internal/tool/fuzz"
shift

echo "Building..."
go-fuzz-build -o=".work/$PKG-fuzz.zip" $PKG_PATH/$PKG

echo "Fuzzing..."
go-fuzz -bin=".work/$PKG-fuzz.zip" -workdir=".work/$PKG"
go-fuzz -bin=".work/$PKG-fuzz.zip" -workdir=".work/$PKG" "$@"

0 comments on commit ca9a1d2

Please sign in to comment.