find-memory-leaks-in-case-of-error (324B)
1 #!/bin/sh 2 3 for file in memory/*.cho; do 4 valgrind --leak-check=full \ 5 --xml=yes \ 6 --xml-file="$file.errors" \ 7 ../lorid "$file" \ 8 &> /dev/null 9 n=$(grep -c '<error>' "$file.errors") 10 if [ $n -gt 0 ]; then 11 echo -e "\033[1;31mERR\033[0m $file" 12 else 13 echo -e " \033[1;32mOK\033[0m $file" 14 fi 15 rm "$file.errors" 16 done