C++ Library containing a lot of needful things: Stack Trace, Command Line Parser, Resource Handling, Configuration Files, Unix Command Execution, Directories, Regular Expressions, Tokenizer, Function Trace, Standard Extensions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

valcheck.sh 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #! /bin/bash
  2. # (c) Siemens Schweiz AG, vertraulich
  3. # $Id: checklatest.sh 323 2007-02-23 15:32:45Z chawama0 $
  4. #
  5. # 1 2 3 4 5 6 7 8
  6. # 3456789012345676890123456789012345678901234567890123456789012345678901234567890
  7. printUsage() {
  8. echo "Usage: $0 <program-to-check>"
  9. echo ""
  10. echo "This script checks a program using valgrind."
  11. return 0
  12. }
  13. if [ $# -ne 1 -o "$1" = "-h" -o "$1" = "--help" ] ; then
  14. printUsage
  15. exit 1
  16. fi
  17. if ! valgrind \
  18. --show-reachable=yes \
  19. --leak-check=full \
  20. --gen-suppressions=all \
  21. --log-file-exactly=valgrind.log \
  22. --suppressions=$(dirname $0)/suppressions.valgrind \
  23. $1; then
  24. echo "******** Valcheck: Testfall fehlgeschlagen! (normaler Fehler)"
  25. exit 1
  26. fi
  27. if ! ( ( grep 'ERROR SUMMARY: 0 errors from 0 contexts' valgrind.log \
  28. && \
  29. ( grep 'definitely lost: 0 bytes in 0 blocks' valgrind.log \
  30. && \
  31. grep 'possibly lost: 0 bytes in 0 blocks' valgrind.log \
  32. && \
  33. grep 'still reachable: 0 bytes in 0 blocks' valgrind.log \
  34. ||
  35. grep 'All heap blocks were freed -- no leaks are possible' \
  36. valgrind.log
  37. )
  38. ) 2>&1 > /dev/null ); then
  39. mv valgrind.log valgrind-$(basename $1).error
  40. echo "******** Valcheck: Speicherfehler! Siehe valgrind-$(basename $1).error"
  41. exit 1
  42. fi
  43. rm valgrind.log