[Travis CI] Add new matrix entry: run test suite under Valgrind

v0.27.3
Dan Čermák 7 years ago
parent ed28e15152
commit 0f43d0f49d

@ -6,7 +6,15 @@ matrix:
dist: trusty dist: trusty
sudo: required sudo: required
compiler: gcc compiler: gcc
env: COVERAGE=1 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DBUILD_WITH_COVERAGE=ON -DEXIV2_TEAM_USE_SANITIZERS=ON" # All enabled + Coverage env: COVERAGE=1 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DBUILD_WITH_COVERAGE=ON" # All enabled + Coverage
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- WITH_VALGRIND=1
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON"
- os: linux - os: linux
dist: trusty dist: trusty
@ -19,7 +27,7 @@ matrix:
- sourceline: 'ppa:ubuntu-toolchain-r/test' - sourceline: 'ppa:ubuntu-toolchain-r/test'
packages: packages:
- g++-8 - g++-8
env: CC=gcc-8 CXX=g++-8 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_TEAM_USE_SANITIZERS=ON" env: CC=gcc-8 CXX=g++-8 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON"
- os: linux - os: linux
dist: trusty dist: trusty
@ -29,7 +37,7 @@ matrix:
- os: osx - os: osx
osx_image: xcode9 osx_image: xcode9
compiler: clang compiler: clang
env: PYTHON=3.6.2 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_TEAM_USE_SANITIZERS=ON" # All enabled env: PYTHON=3.6.2 CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON" # All enabled
env: env:
#- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release" # Default #- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release" # Default

@ -6,6 +6,9 @@ if [[ "$(uname -s)" == 'Linux' ]]; then
sudo apt-get update sudo apt-get update
sudo apt-get install cmake zlib1g-dev libssh-dev gettext sudo apt-get install cmake zlib1g-dev libssh-dev gettext
sudo apt-get install python-pip libxml2-utils sudo apt-get install python-pip libxml2-utils
if [ -n "$WITH_VALGRIND" ]; then
sudo apt-get install valgrind
fi
sudo pip install virtualenv sudo pip install virtualenv
virtualenv conan virtualenv conan
source conan/bin/activate source conan/bin/activate

@ -5,7 +5,17 @@ set -x
if [[ "$(uname -s)" == 'Linux' ]]; then if [[ "$(uname -s)" == 'Linux' ]]; then
source conan/bin/activate source conan/bin/activate
if [ "$CC" == "clang" ]; then
# clang + Ubuntu don't like to run with UBSAN, but ASAN works
export CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_CXX_FLAGS=\"-fsanitize=address\" -DCMAKE_C_FLAGS=\"-fsanitize=address\" -DCMAKE_EXE_LINKER_FLAGS=\"-fsanitize=address\" -DCMAKE_MODULE_LINKER_FLAGS=\"-fsanitize=address\""
elif [ -n "$WITH_VALGRIND" ]; then
export EXIV2_VALGRIND="valgrind --quiet"
else
export CMAKE_OPTIONS="$CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=ON"
fi
else else
export CMAKE_OPTIONS="$CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=ON"
export PYENV_VERSION=$PYTHON export PYENV_VERSION=$PYTHON
export PATH="/Users/travis/.pyenv/shims:${PATH}" export PATH="/Users/travis/.pyenv/shims:${PATH}"
eval "$(pyenv init -)" eval "$(pyenv init -)"
@ -16,15 +26,17 @@ fi
mkdir build && cd build mkdir build && cd build
conan install .. --build missing --profile release conan install .. --build missing --profile release
cmake ${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=install .. cmake ${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=install ..
make -j2 VERBOSE=1 make -j2 VERBOSE=1
make tests make tests
make install make install
pushd .
cd bin cd bin
./unit_tests $EXIV2_VALGRIND ./unit_tests
popd
if [ -n "$COVERAGE" ]; then if [ -n "$COVERAGE" ]; then
cd ..
bash <(curl -s https://codecov.io/bash) bash <(curl -s https://codecov.io/bash)
fi fi

@ -1,9 +1,11 @@
[General] [General]
timeout: 1 timeout: 1
memcheck: ${ENV:valgrind}
[ENV] [ENV]
exiv2_path: EXIV2_BINDIR exiv2_path: EXIV2_BINDIR
binary_extension: EXIV2_EXT binary_extension: EXIV2_EXT
valgrind: EXIV2_VALGRIND
[ENV fallback] [ENV fallback]
exiv2_path: ../build/bin exiv2_path: ../build/bin

Loading…
Cancel
Save