Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Copyright (c) 2016, Google Inc.
  2. #
  3. # Permission to use, copy, modify, and/or distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. set -e
  15. buildDir=../build
  16. if [ $# -gt 0 ]; then
  17. buildDir=$1
  18. fi
  19. for testSource in $(ls -1 *.cc); do
  20. test=$(echo $testSource | sed -e 's/\.cc$//')
  21. if [ ! -x $buildDir/fuzz/$test ] ; then
  22. echo "Failed to find binary for $test"
  23. exit 1
  24. fi
  25. if [ ! -d ${test}_corpus ]; then
  26. echo "Failed to find corpus directory for $test"
  27. exit 1
  28. fi
  29. if [ -d ${test}_corpus_old ]; then
  30. echo "Old corpus directory for $test already exists"
  31. exit 1
  32. fi
  33. done
  34. for testSource in $(ls -1 *.cc); do
  35. test=$(echo $testSource | sed -e 's/\.cc$//')
  36. mv ${test}_corpus ${test}_corpus_old
  37. mkdir ${test}_corpus
  38. $buildDir/fuzz/$test -max_len=50000 -merge=1 ${test}_corpus ${test}_corpus_old
  39. rm -Rf ${test}_corpus_old
  40. done