add check script for regression testing

Run the fuzz targets over the seed corpus with the standalone driver as part of
the test suite.
This commit is contained in:
Oscar Mira 2019-03-14 16:30:05 +01:00
parent f3cdf25923
commit f2745e19c9
7 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,6 @@
TESTS = \
test_fuzz.sh
FUZZPROGS = \
jpegsave_buffer_fuzzer \
pngsave_buffer_fuzzer \
@ -16,5 +19,7 @@ LDADD = ${top_builddir}/libvips/libvips.la @VIPS_LIBS@ @LIB_FUZZING_ENGINE@
libstandaloneengine_a_SOURCES = StandaloneFuzzTargetMain.c
noinst_PROGRAMS = $(FUZZPROGS)
check_PROGRAMS = $(FUZZPROGS)
noinst_LIBRARIES = $(FUZZLIBS)
EXTRA_DIST = $(TESTS)

View File

View File

View File

20
fuzz/test_fuzz.sh Executable file
View File

@ -0,0 +1,20 @@
#!/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"
# Hide all warning messages from vips.
export VIPS_WARNING=0
ret=0
for fuzzer in *_fuzzer; do
find "${fuzzer}_corpus" -type f -not -empty -print0 \
| xargs -0 -n1 "./$fuzzer" || ret=1
done
exit $ret

View File

View File