libvips/fuzz/test_fuzz.sh

27 lines
535 B
Bash
Raw Normal View History

#!/bin/sh
#set -x
set -e
# Glib is build without -fno-omit-frame-pointer. We need
# to disable the fast unwinder to get full stacktraces.
export ASAN_OPTIONS="fast_unwind_on_malloc=0:allocator_may_return_null=1"
2019-08-02 12:23:39 +02:00
export UBSAN_OPTIONS="print_stacktrace=1"
# Hide all warning messages from vips.
export VIPS_WARNING=0
ret=0
for fuzzer in *_fuzzer; do
2019-10-07 14:30:19 +02:00
fail=0
2019-08-19 18:45:03 +02:00
find "common_fuzzer_corpus" -type f -not -empty -print0 \
2019-10-07 14:30:19 +02:00
| xargs -0 -n1 "./$fuzzer" || fail=1
if [ $fail ]; then
echo FAIL $fuzzer
ret=1
fi
done
exit $ret