File size: 1,112 Bytes
910a777
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

# Temporarily ignore corpus checking in memory sanitizer mode.
if [[ ${SANITIZER} == "memory" ]]
then
  echo "Temporarily ignore corpuses in memory mode, to let ossfuzz have fun"
  exit 0
fi

# Exit if the build root has not been defined.
[[ -d ${BUILD_ROOT} ]] || exit 1

. ${BUILD_ROOT}/scripts/fuzz_targets

if [[ ${DEBUG} == 1 ]]
then
  set -ex
else
  set -e
fi

# Allows us to add an extra testing corpus locally.
if [[ -d ./extra_corpus ]]
then
    EXTRA_CORPUS=./extra_corpus/
else
    EXTRA_CORPUS=
fi

for TARGET in ${FUZZ_TARGETS}
do
  if [[ ${TARGET} == "curl_fuzzer_ftp" ]] || [[ ${TARGET} == "curl_fuzzer_smtp" ]] || [[ ${TARGET} == "curl_fuzzer_smtp" ]] || [[ ${TARGET} == "curl_fuzzer" ]]
  then
    # For the moment, disable some problematic corpuses
    echo "Skipping ${TARGET}"
  else
    if [[ ${DEBUG} == 1 ]]
    then
      # Call tests individually
      PERCALL=1
    else
      # Call tests 100 at a time for speed.
      PERCALL=100
    fi

    find ${BUILD_ROOT}/corpora/${TARGET}/ ${EXTRA_CORPUS} -type f -print0 | xargs -0 -L${PERCALL} ${BUILD_ROOT}/${TARGET}
  fi
done