forked from bblanchon/ArduinoJson
Travis: Added Clang AddressSanitizer and UndefinedBehaviorSanitizer
This commit is contained in:
@ -70,6 +70,12 @@ matrix:
|
|||||||
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 CMAKE_CXX_COMPILER=clang++-3.8
|
||||||
|
- 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
|
||||||
|
@ -18,4 +18,8 @@ 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)
|
||||||
|
7
scripts/travis/sanitize.sh
Executable file
7
scripts/travis/sanitize.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/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 .
|
||||||
|
make
|
||||||
|
make test
|
@ -12,7 +12,6 @@ file(GLOB TESTS_FILES *.hpp *.cpp)
|
|||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-fno-exceptions
|
-fno-exceptions
|
||||||
-fno-rtti
|
|
||||||
-pedantic
|
-pedantic
|
||||||
-Wall
|
-Wall
|
||||||
-Wcast-align
|
-Wcast-align
|
||||||
|
Reference in New Issue
Block a user