Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ before_install:
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
# - . ~/otp/18.2.1/activate && erl -version
#- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
# install valgrind for C++ memory test
- sudo apt-get install valgrind
# install Qt 5.10
- sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty
- sudo apt-get update -qq
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/cpp-qt5/PetStore/PetStore.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ SOURCES += main.cpp \
HEADERS += PetApiTests.h \
StoreApiTests.h \
UserApiTests.h

# Disable optimisation for better valgrind report
QMAKE_CXXFLAGS_DEBUG += -O0
37 changes: 34 additions & 3 deletions samples/client/petstore/cpp-qt5/build-and-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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