continuable/.travis.yml
2017-10-03 17:02:23 +02:00

85 lines
1.8 KiB
YAML

sudo: false
dist: trusty
language: cpp
cache: apt
git:
depth: 1
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- valgrind
- cmake
- cmake-data
env:
- COMPILER=g++-7
- os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- g++-7
- clang-5.0
- cmake
- cmake-data
env:
- COMPILER=clang++-5.0
install:
- export CXX=$COMPILER
- $CXX --version
# Function for creating a new 'build' directory
- |
function renew_build {
echo "Renew build directory..."
cd $TRAVIS_BUILD_DIR
# Remove any existing build directory
[ -e build ] && rm -r -f build
mkdir build
cd build
# Configure the project and build it
cmake -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Werror" -DCMAKE_BUILD_TYPE=Debug ..
}
script:
- |
if [[ $COMPILER == *"clang"* ]]; then
# Build the test suite with various sanitizers:
# - ASan (LSan):
echo "Building with address sanitizer..."
CMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer"
renew_build
make -j2
ctest --verbose
# - UBSan:
echo "Building with undefined behaviour sanitizer..."
CMAKE_CXX_FLAGS="-fsanitize=undefined -fno-omit-frame-pointer"
renew_build
make -j2
ctest --verbose
else
# Build an run the tests suite with valgrind
renew_build
make -j2
valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes ctest --verbose
fi
notifications:
email: false