mirror of
https://github.com/project-zot/zot.git
synced 2025-01-27 23:01:43 -05:00
18 lines
482 B
Bash
18 lines
482 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
fuzzTime=${1:-10}
|
||
|
|
||
|
files=$(grep -r --include='**_test.go' --files-with-matches 'func Fuzz' .)
|
||
|
|
||
|
for file in ${files}
|
||
|
do
|
||
|
funcs=$(grep -oP 'func \K(Fuzz\w*)' $file)
|
||
|
for func in ${funcs}
|
||
|
do
|
||
|
echo "Fuzzing $func in $file"
|
||
|
parentDir=$(dirname $file)
|
||
|
go test $parentDir -run=$func -fuzz=$func$ -fuzztime=${fuzzTime}s -tags sync,metrics,search,scrub,ui_base,containers_image_openpgp | grep -oP -x '^(?:(?!\blevel\b).)*$'
|
||
|
done
|
||
|
done
|