continuable/.travis.yml
2017-11-13 13:32:16 +01:00

109 lines
2.4 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++-6
- valgrind
- cmake
- cmake-data
- ninja-build
env:
- COMPILER=g++-6
- NO_EXCEPTIONS=OFF
- WITH_AWAIT=OFF
- os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- g++-6
- clang-5.0
- cmake
- cmake-data
- ninja-build
env:
- COMPILER=clang++-5.0
- NO_EXCEPTIONS=OFF
- WITH_AWAIT=OFF
- os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- g++-6
- clang-5.0
- cmake
- cmake-data
- ninja-build
env:
- COMPILER=clang++-5.0
- NO_EXCEPTIONS=ON
- WITH_AWAIT=ON
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 -GNinja -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -Werror" -DCTI_CONTINUABLE_WITH_NO_EXCEPTIONS=$NO_EXCEPTIONS -DCTI_CONTINUABLE_WITH_AWAIT=$WITH_AWAIT -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
ninja -j2
ctest --verbose
# - UBSan:
echo "Building with undefined behaviour sanitizer..."
CMAKE_CXX_FLAGS="-fsanitize=undefined -fno-omit-frame-pointer"
renew_build
ninja -j2
ctest --verbose
else
# Build an run the tests suite with valgrind
renew_build
ninja -j2
valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes ctest --verbose
fi
notifications:
email: false