2016-12-14 21:57:22 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-01-16 18:33:22 +01:00
|
|
|
# Copyright (c) 2016-2019, The Tor Project, Inc.
|
2016-12-14 21:57:22 +01:00
|
|
|
# See LICENSE for licensing information
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-01-27 17:16:23 +01:00
|
|
|
if [ -z "${TOR_FUZZ_CORPORA}" ] || [ ! -d "${TOR_FUZZ_CORPORA}" ] ; then
|
|
|
|
echo "You need to set TOR_FUZZ_CORPORA to point to a checkout of "
|
|
|
|
echo "the 'fuzzing-corpora' repository."
|
|
|
|
exit 77
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-14 21:57:22 +01:00
|
|
|
for fuzzer in "${builddir:-.}"/src/test/fuzz/fuzz-* ; do
|
2019-02-02 16:14:49 +01:00
|
|
|
f=$(basename "$fuzzer")
|
2016-12-14 21:57:22 +01:00
|
|
|
case="${f#fuzz-}"
|
2017-01-27 17:16:23 +01:00
|
|
|
if [ -d "${TOR_FUZZ_CORPORA}/${case}" ]; then
|
|
|
|
echo "Running tests for ${case}"
|
|
|
|
for entry in "${TOR_FUZZ_CORPORA}/${case}/"*; do
|
|
|
|
"${fuzzer}" "--err" < "$entry"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
echo "No tests found for ${case}"
|
|
|
|
fi
|
2016-12-14 21:57:22 +01:00
|
|
|
done
|