diff options
Diffstat (limited to 'src/plugins/fuzz_default.sh')
-rwxr-xr-x | src/plugins/fuzz_default.sh | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/fuzz_default.sh b/src/plugins/fuzz_default.sh index 67292cf..7418dff 100755 --- a/src/plugins/fuzz_default.sh +++ b/src/plugins/fuzz_default.sh | |||
@@ -1,28 +1,32 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | set -eu | ||
4 | |||
3 | ZZSTARTSEED=0 | 5 | ZZSTARTSEED=0 |
4 | ZZSTOPSEED=100 | 6 | ZZSTOPSEED=100 |
5 | ret=0 | 7 | ret=0 |
6 | # fallbacks for direct, non-"make check" usage | 8 | # fallbacks for direct, non-"make check" usage |
7 | if test x"$testdatadir" = x"" | 9 | if test x"${testdatadir:-NONE}" = xNONE"" |
8 | then | 10 | then |
9 | testdatadir=../../test | 11 | testdatadir=../../test |
10 | fi | 12 | fi |
11 | if test x"$bindir" = x"" | 13 | if test x"${bindir:-NONE}" = xNONE"" |
12 | then | 14 | then |
13 | bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3` | 15 | bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3` |
14 | bindir="$bindir/bin" | 16 | bindir="$bindir/bin" |
15 | fi | 17 | fi |
16 | 18 | ||
17 | if test -x `which zzuf` | 19 | if test ! -x `which zzuf` |
18 | then | 20 | then |
21 | echo "zzuf not available, not running the test" | ||
19 | exit 77 | 22 | exit 77 |
20 | fi | 23 | fi |
21 | 24 | ||
22 | if test -x `which timeout` | 25 | if test -x `which timeout` |
23 | then | 26 | then |
24 | TIMEOUT=timeout 15 | 27 | TIMEOUT="timeout 15" |
25 | else | 28 | else |
29 | echo "timeout command not found, will not auto-timeout (may cause hang)" | ||
26 | TIMEOUT="" | 30 | TIMEOUT="" |
27 | fi | 31 | fi |
28 | 32 | ||
@@ -37,7 +41,7 @@ do | |||
37 | do | 41 | do |
38 | echo "file $file seed $seed" | 42 | echo "file $file seed $seed" |
39 | zzuf -c -s $seed cat "$file" > "$tmpfile" | 43 | zzuf -c -s $seed cat "$file" > "$tmpfile" |
40 | if ! "$TIMEOUT $bindir/extract" -i "$tmpfile" > /dev/null | 44 | if ! $TIMEOUT $bindir/extract -i "$tmpfile" > /dev/null |
41 | then | 45 | then |
42 | echo "$tmpfile with seed $seed failed" | 46 | echo "$tmpfile with seed $seed failed" |
43 | mv $tmpfile $tmpfile.keep | 47 | mv $tmpfile $tmpfile.keep |