Travis: Added -fsanitize to several builds

This commit is contained in:
Benoit Blanchon
2017-01-21 19:49:44 +01:00
parent 17a17c8957
commit fb554071dc
5 changed files with 44 additions and 49 deletions

View File

@ -7,97 +7,91 @@ matrix:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.4'] packages: ['g++-4.4']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-4.4 env: SCRIPT=cmake GCC=4.4
- compiler: gcc - compiler: gcc
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.5'] packages: ['g++-4.5']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-4.5 env: SCRIPT=cmake GCC=4.5
- compiler: gcc - compiler: gcc
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.6'] packages: ['g++-4.6']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-4.6 env: SCRIPT=cmake GCC=4.6
- compiler: gcc - compiler: gcc
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.7'] packages: ['g++-4.7']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-4.7 env: SCRIPT=cmake GCC=4.7
- compiler: gcc - compiler: gcc
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8'] packages: ['g++-4.8']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-4.8 env: SCRIPT=cmake GCC=4.8 SANITIZE=address
- compiler: gcc - compiler: gcc
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9'] packages: ['g++-4.9']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-4.9 env: SCRIPT=cmake GCC=4.9 SANITIZE=leak
- compiler: gcc - compiler: gcc
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test'] sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5'] packages: ['g++-5']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=g++-5 env: SCRIPT=cmake GCC=5 SANITIZE=undefined
- compiler: clang - compiler: clang
env: SCRIPT=cmake CMAKE_CXX_COMPILER=clang++ env: SCRIPT=cmake
- compiler: clang - compiler: clang
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5'] sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5']
packages: ['clang-3.5'] packages: ['clang-3.5']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=clang++-3.5 env: SCRIPT=cmake CLANG=3.5 SANITIZE=address
- compiler: clang - compiler: clang
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.6'] sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.6']
packages: ['clang-3.6'] packages: ['clang-3.6']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=clang++-3.6 env: SCRIPT=cmake CLANG=3.6 SANITIZE=leak
- compiler: clang - compiler: clang
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.7'] sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.7']
packages: ['clang-3.7'] packages: ['clang-3.7']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=clang++-3.7 env: SCRIPT=cmake CLANG=3.7
- compiler: clang - compiler: clang
addons: addons:
apt: apt:
sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.8'] sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.8']
packages: ['clang-3.8'] packages: ['clang-3.8']
env: SCRIPT=cmake CMAKE_CXX_COMPILER=clang++-3.8 env: SCRIPT=cmake CLANG=3.8 SANITIZE=undefined
- compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test','llvm-toolchain-precise-3.8']
packages: ['clang-3.8']
env: SCRIPT=sanitize CMAKE_CXX_COMPILER=clang++-3.8
- compiler: gcc - compiler: gcc
env: SCRIPT=coverage env: SCRIPT=coverage
- os: osx - os: osx
osx_image: xcode6.4 osx_image: xcode6.4
compiler: clang compiler: clang
env: SCRIPT=cmake-osx env: SCRIPT=cmake
- os: osx - os: osx
osx_image: xcode7 osx_image: xcode7
compiler: clang compiler: clang
env: SCRIPT=cmake-osx env: SCRIPT=cmake
- os: osx - os: osx
osx_image: xcode7.1 osx_image: xcode7.1
compiler: clang compiler: clang
env: SCRIPT=cmake-osx env: SCRIPT=cmake
- os: osx - os: osx
osx_image: xcode7.2 osx_image: xcode7.2
compiler: clang compiler: clang
env: SCRIPT=cmake-osx env: SCRIPT=cmake
- os: osx - os: osx
osx_image: xcode7.3 osx_image: xcode7.3
compiler: clang compiler: clang
env: SCRIPT=cmake-osx env: SCRIPT=cmake SANITIZE=address
- env: SCRIPT=arduino VERSION=1.6.7 BOARD=arduino:avr:uno - env: SCRIPT=arduino VERSION=1.6.7 BOARD=arduino:avr:uno
- env: SCRIPT=arduino VERSION=1.6.12 BOARD=arduino:avr:uno - env: SCRIPT=arduino VERSION=1.6.12 BOARD=arduino:avr:uno
- env: SCRIPT=platformio BOARD=uno - env: SCRIPT=platformio BOARD=uno

View File

@ -18,8 +18,4 @@ if(${COVERAGE})
set(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") set(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
endif() endif()
if(${SANITIZE})
set(CMAKE_CXX_FLAGS "-fsanitize=address,undefined")
endif()
add_subdirectory(test) add_subdirectory(test)

View File

@ -1,9 +0,0 @@
#!/bin/sh -eux
URL=https://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz
curl -sS $URL | tar xz -C /tmp --strip 1
/tmp/CMake.app/Contents/bin/cmake .
make
make test

View File

@ -1,9 +1,30 @@
#!/bin/sh -eux #!/bin/sh -ex
URL=https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz
if [ $(uname) = 'Darwin' ]; then
URL=https://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.tar.gz
CMAKE=/tmp/CMake.app/Contents/bin/cmake
CTEST=/tmp/CMake.app/Contents/bin/ctest
else
URL=https://cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz
CMAKE=/tmp/bin/cmake
CTEST=/tmp/bin/ctest
fi
curl -sS $URL | tar xz -C /tmp --strip 1 curl -sS $URL | tar xz -C /tmp --strip 1
/tmp/bin/cmake -DCMAKE_CXX_COMPILER=$CMAKE_CXX_COMPILER . if [ -n "$GCC" ]; then
make export CC="gcc-$GCC"
make test export CXX="g++-$GCC"
fi
if [ -n "$CLANG" ]; then
export CC="clang-$CLANG"
export CXX="clang++-$CLANG"
fi
if [ -n "$SANITIZE" ]; then
export CXXFLAGS="-fsanitize=$SANITIZE"
fi
$CMAKE .
$CMAKE --build .
$CTEST -VV .

View File

@ -1,7 +0,0 @@
#!/bin/sh -eux
curl https://cmake.org/files/v3.4/cmake-3.4.0-Linux-x86_64.tar.gz | tar xz -C /tmp --strip 1
/tmp/bin/cmake -DSANITIZE=true .
cmake --build .
ctest -VV .