forked from loafle/openapi-generator-original
cpp-qt5-client: add valgrind memory test (#3663)
This commit is contained in:
@@ -2,10 +2,41 @@
|
||||
|
||||
set -e
|
||||
|
||||
mkdir build
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
qmake ../PetStore/PetStore.pro
|
||||
qmake ../PetStore/PetStore.pro CONFIG+=debug
|
||||
|
||||
make
|
||||
|
||||
./PetStore
|
||||
valgrind --leak-check=full ./PetStore |& tee result.log || exit 1
|
||||
|
||||
echo "Make sure the tests are launched:"
|
||||
testCount=$(cat result.log | grep 'Finished testing of' | wc -l)
|
||||
if [ $testCount == 3 ]
|
||||
then
|
||||
echo "Ok"
|
||||
else
|
||||
echo "The tests were not run!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Make sure the tests passed:"
|
||||
successCount=$(cat result.log | grep '0 failed' | wc -l)
|
||||
if [ $successCount == 3 ]
|
||||
then
|
||||
echo "Ok"
|
||||
else
|
||||
echo "The tests failed!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Check if no memory leaks occured:"
|
||||
leakCount=$(cat result.log | grep 'lost: 0 bytes in 0 blocks' | wc -l)
|
||||
if [ $leakCount == 3 ]
|
||||
then
|
||||
echo "Ok"
|
||||
else
|
||||
echo "There was memory leaks!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user