Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:02

0001 #!/bin/bash -e
0002 
0003 SCRIPT_NAME=$(basename $0)
0004 TEST_NAME="test-valgrind-memleak"
0005 which ${TEST_NAME}
0006 valgrind --leak-check=full --undef-value-errors=no --error-limit=no \
0007          ${TEST_NAME} > ${SCRIPT_NAME}.log 2>&1
0008 
0009 cat ${SCRIPT_NAME}.log
0010 echo ""
0011 COUNT=$(grep 'definitely lost: [1-9][0-9]*' ${SCRIPT_NAME}.log | wc -l)
0012 rm -f ${SCRIPT_NAME}.log
0013 
0014 if [ $COUNT -eq 0 ] ; then
0015   echo "ERROR: Valgrind was suppose to find memory leaks"
0016   exit 1
0017 else
0018   echo "ALL OK"
0019 fi