Include types from gonavitia/navitia
This commit is contained in:
parent
82769f923e
commit
24b1102761
157 changed files with 26062 additions and 116 deletions
43
types/fuzz.sh
Executable file
43
types/fuzz.sh
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
shopt -s extglob
|
||||
declare -A functionNames
|
||||
functionNames=(["FuzzJourney"]="journey" ["FuzzPlaceCountainer"]="place")
|
||||
|
||||
echo "Functions that will be built:"
|
||||
printf "\t- %s\n" "${!functionNames[@]}"
|
||||
|
||||
workdirPath="/tmp/fuzz"
|
||||
echo "Creating global workdir: $workdirPath"
|
||||
mkdir $workdirPath
|
||||
|
||||
for i in "${!functionNames[@]}"
|
||||
do
|
||||
path="$workdirPath/$i"
|
||||
mkdir $path
|
||||
mkdir "$path/corpus"
|
||||
binpath="$path/$i.zip"
|
||||
|
||||
corpuspath="./testdata/${functionNames[$i]}"
|
||||
echo "Copying corpus for $i from $corpuspath"
|
||||
cp $corpuspath/known/* "$path/corpus/"
|
||||
cp $corpuspath/corpus/* "$path/corpus/"
|
||||
|
||||
echo "Building $i"
|
||||
go-fuzz-build -func $i -o $binpath github.com/aabizri/gonavitia/types
|
||||
|
||||
echo "Running $i ($binpath)"
|
||||
go-fuzz -bin $binpath -workdir=$path
|
||||
|
||||
echo "Copying back corpus from $corpuspath"
|
||||
destination="./testdata/${functionNames[$i]}/corpus"
|
||||
rsync --exclude="*.json" $path/corpus/* $destination/
|
||||
|
||||
echo "Copying crashers"
|
||||
destination="./testdata/${functionNames[$i]}/crasher"
|
||||
commit=`git rev-parse HEAD`
|
||||
for j in $path/crashers/*
|
||||
do
|
||||
filename=$commit-${j##*/}
|
||||
cp $j $destination/$filename
|
||||
done
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue