diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-01-27 11:16:23 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-30 08:37:27 -0500 |
commit | d71fc474385281453eaa93522479d32af85c94ef (patch) | |
tree | 30ed6c8ae1f20ff2bd7e37be07c7a12e67e588c9 /src | |
parent | 2202ad7ab0132ed5505067aca9020caa05c918fd (diff) | |
download | tor-d71fc474385281453eaa93522479d32af85c94ef.tar.gz tor-d71fc474385281453eaa93522479d32af85c94ef.zip |
Update documentation and testing integration for fuzzing
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/include.am | 2 | ||||
-rwxr-xr-x | src/test/fuzz_static_testcases.sh | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/test/fuzz/include.am b/src/test/fuzz/include.am index bca0a8626a..c9c1747769 100644 --- a/src/test/fuzz/include.am +++ b/src/test/fuzz/include.am @@ -246,3 +246,5 @@ noinst_LIBRARIES += $(OSS_FUZZ_FUZZERS) oss-fuzz-fuzzers: oss-fuzz-prereqs $(OSS_FUZZ_FUZZERS) fuzzers: $(FUZZERS) $(LIBFUZZER_FUZZERS) +fuzz: $(FUZZERS) + $(top_srcdir)/src/test/fuzz_static_testcases.sh diff --git a/src/test/fuzz_static_testcases.sh b/src/test/fuzz_static_testcases.sh index 276bc6e157..bfe1677573 100755 --- a/src/test/fuzz_static_testcases.sh +++ b/src/test/fuzz_static_testcases.sh @@ -5,11 +5,23 @@ set -e +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 + + + for fuzzer in "${builddir:-.}"/src/test/fuzz/fuzz-* ; do f=`basename $fuzzer` case="${f#fuzz-}" - echo "Running tests for ${case}" - for entry in ${abs_top_srcdir:-.}/src/test/fuzz/data/${case}/*; do - "${fuzzer}" "--err" < "$entry" - done + 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 done |