Skip to content

Commit 46a8661

Browse files
committed
Add cron jobs for sanitizers and libc++ debug mode
1 parent b9372f1 commit 46a8661

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.travis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,27 @@ jobs:
241241
- COMPILER="ccache g++"
242242
script: echo "This is coverity build. No need for tests."
243243

244+
- stage: Extended checks
245+
env:
246+
- NAME="sanitized build"
247+
if: type = cron
248+
addons:
249+
apt:
250+
sources:
251+
- ubuntu-toolchain-r-test
252+
packages:
253+
- libc++-dev
254+
os: linux
255+
compiler: clang
256+
cache: ccache
257+
install:
258+
- ccache -z
259+
- ccache --max-size=1G
260+
- cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Sanitized -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_CXX_FLAGS="-Wno-error=unused-command-line-argument -stdlib=libc++"
261+
- cmake --build build -- -j4
262+
script: (cd build; ctest -j2 -V -L CORE)
263+
264+
244265
allow_failures:
245266
- <<: *formatting-stage
246267
- <<: *linter-stage

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.2)
22

3+
include(cmake/set_up_configs.cmake)
4+
35
find_program(CCACHE_PROGRAM ccache)
46
if(CCACHE_PROGRAM)
57
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")

cmake/set_up_configs.cmake

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if(NOT CONFIGURATIONS_HAVE_BEEN_SET_UP)
2+
set(CONFIGURATIONS_HAVE_BEEN_SET_UP true)
3+
set(build_types_string "Debug;Release;RelWithDebInfo;Sanitized;LibCPPDebug")
4+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY HELPSTRING "Choose the type of build")
5+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${build_types_string}")
6+
set(CMAKE_CONFIGURATION_TYPES "${build_types_string}" CACHE STRING "" FORCE)
7+
8+
set(CMAKE_CXX_FLAGS_SANITIZED "-fsanitize=address,undefined")
9+
set(CMAKE_CXX_FLAGS_LIBCPPDEBUG "-D_LIBCPP_DEBUG=1 -D_GLIBCXX_DEBUG")
10+
endif()

0 commit comments

Comments
 (0)