tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

fuzz_static_testcases.sh (676B)


      1 #!/bin/sh
      2 
      3 # Copyright (c) 2016-2019, The Tor Project, Inc.
      4 # See LICENSE for licensing information
      5 
      6 set -e
      7 
      8 if [ -z "${TOR_FUZZ_CORPORA}" ] || [ ! -d "${TOR_FUZZ_CORPORA}" ] ; then
      9    echo "You need to set TOR_FUZZ_CORPORA to point to a checkout of "
     10    echo "the 'fuzzing-corpora' repository."
     11    exit 77
     12 fi
     13 
     14 
     15 
     16 for fuzzer in "${builddir:-.}"/src/test/fuzz/fuzz-* ; do
     17    f=$(basename "$fuzzer")
     18    case="${f#fuzz-}"
     19    if [ -d "${TOR_FUZZ_CORPORA}/${case}" ]; then
     20        echo "Running tests for ${case}"
     21        for entry in "${TOR_FUZZ_CORPORA}/${case}/"*; do
     22     "${fuzzer}" "--err" < "$entry"
     23        done
     24    else
     25 echo "No tests found for ${case}"
     26    fi
     27 done