blob: e9b62b1bd3e352b7506f55c72da5403409097312 [file] [log] [blame]
onqtame85b1bb2016-06-26 16:41:09 +03001# this file is HEAVILY influenced by https://github.com/boostorg/hana/blob/master/.travis.yml
2
onqtame4c75fc2016-05-21 01:24:48 +03003sudo: false
4language: c++
5
6notifications:
onqtamf5169772016-09-09 18:33:13 +03007 email: false
onqtame4c75fc2016-05-21 01:24:48 +03008 # gitter
9 webhooks:
10 urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706
11 on_success: change
12 on_failure: always
13git:
onqtam9f934f82016-08-02 12:42:19 +030014 depth: 500
onqtame4c75fc2016-05-21 01:24:48 +030015
16# both apt and ccache make the builds slower...
17#cache:
18# - apt
19# - ccache
20
21env:
22 global:
23# - USE_CCACHE=1
24# - CCACHE_SLOPPINESS=pch_defines,time_macros
25# - CCACHE_COMPRESS=1
26# - CCACHE_MAXSIZE=200M
27# - CCACHE_CPP2=1
28 - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
29 # Workaround for https://github.com/travis-ci/travis-ci/issues/4681
30 # "Defining the build matrix only with matrix.include leads to an additional, unwanted job"
31 matrix:
32 - TRAVIS_EMPTY_JOB_WORKAROUND=true
33
34addons:
35 coverity_scan:
36 # COVERITY_SCAN_TOKEN added as env var in travis project
37 project:
38 name: onqtam/doctest
39 notification_email: vik.kirilov@gmail.com
40 build_command_prepend: cd examples/hello_world && cmake .
41 build_command: make
42 branch_pattern: coverity_scan
43 # these apt sources will be referenced later (by using *name)
44 apt:
onqtam2c8036f2016-06-26 17:12:42 +030045 sources: &apt_sources
46 - ubuntu-toolchain-r-test
onqtam7e775f92016-11-15 02:41:10 +020047 - llvm-toolchain-precise
onqtamb382bd32016-08-01 20:53:56 +030048 - llvm-toolchain-precise-3.5
49 - llvm-toolchain-precise-3.6
50 - llvm-toolchain-precise-3.7
51 - llvm-toolchain-precise-3.8
onqtamfd62aa02016-11-15 03:00:44 +020052 - llvm-toolchain-precise-3.9
onqtam3bf83c42017-04-23 15:30:23 +030053 - llvm-toolchain-trusty
54 - llvm-toolchain-trusty-4.0
onqtame4c75fc2016-05-21 01:24:48 +030055
56compiler: clang
57os: linux
58
59matrix:
60 exclude:
61 - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
62
63 include:
onqtamd1737e42016-08-01 19:05:07 +030064 # coverage
onqtamf6d1a512017-05-01 13:56:12 +030065 - env: COMPILER=g++ CODE_COVERAGE=true
onqtamd1737e42016-08-01 19:05:07 +030066 compiler: gcc
67 addons:
68 apt:
onqtamf6d1a512017-05-01 13:56:12 +030069 packages: ["lcov"]
onqtamd1737e42016-08-01 19:05:07 +030070
onqtamf6d1a512017-05-01 13:56:12 +030071# # static code analysis
72# - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true
73# dist: trusty
74# addons: &clang40
75# apt:
76# packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"]
77# sources: *apt_sources
78#
79# # GCC 4.4
80# - env: COMPILER=g++-4.4
81# compiler: gcc
82# addons: &gcc44
83# apt:
84# packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"]
85# sources: *apt_sources
86#
87# # GCC 4.5
88# - env: COMPILER=g++-4.5
89# compiler: gcc
90# addons: &gcc45
91# apt:
92# packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"]
93# sources: *apt_sources
94#
95# # GCC 4.6
96# - env: COMPILER=g++-4.6
97# compiler: gcc
98# addons: &gcc46
99# apt:
100# packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"]
101# sources: *apt_sources
102#
103# # GCC 4.7
104# - env: COMPILER=g++-4.7
105# compiler: gcc
106# addons: &gcc47
107# apt:
108# packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"]
109# sources: *apt_sources
110#
111# # GCC 4.8
112# - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
113# compiler: gcc
114# addons: &gcc48
115# apt:
116# packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
117# sources: *apt_sources
118#
119# # GCC 4.9
120# - env: COMPILER=g++-4.9 HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true # no ASAN_32 - errors when using ASAN_OPTIONS - probably g++ 4.9 bug
121# compiler: gcc
122# addons: &gcc49
123# apt:
124# packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
125# sources: *apt_sources
126#
127# # GCC 5
128# - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold"
129# compiler: gcc
130# addons: &gcc5
131# apt:
132# packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
133# sources: *apt_sources
134#
135# # GCC 6
136# - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold"
137# compiler: gcc
138# addons: &gcc6
139# apt:
140# packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
141# sources: *apt_sources
142#
143# # Clang 3.4
144# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
145# addons: &clang
146# apt:
147# packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
148# sources: *apt_sources
149#
150# # Clang 3.5
151# - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
152# addons: &clang35
153# apt:
154# packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
155# sources: *apt_sources
156#
157# # Clang 3.6
158# - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
159# addons: &clang36
160# apt:
161# packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
162# sources: *apt_sources
163#
164# # Clang 3.7
165# - env: COMPILER=clang++-3.7
166# addons: &clang37
167# apt:
168# packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
169# sources: *apt_sources
170#
171# # Clang 3.8
172# - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true
173# addons: &clang38
174# apt:
175# packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
176# sources: *apt_sources
177#
178# # Clang 3.9
179# - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
180# addons: &clang39
181# apt:
182# packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
183# sources: *apt_sources
184#
185# # Clang 4.0
186# - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
187# dist: trusty
188# addons: &clang40
189# apt:
190# packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
191# sources: *apt_sources
192#
193# # Xcode 6.4 Clang
194# - env: COMPILER=clang++
195# osx_image: xcode6.4
196# os: osx
197#
198# # Xcode 7.3 Clang
199# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
200# osx_image: xcode7.3
201# os: osx
202#
203# # Xcode 8 Clang
204# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
205# osx_image: xcode8
206# os: osx
207#
208# # Xcode 8.1 Clang
209# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
210# osx_image: xcode8.1
211# os: osx
212#
213# # Xcode 8.2 Clang
214# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
215# osx_image: xcode8.2
216# os: osx
217#
218# # Xcode 8.3 Clang
219# - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
220# osx_image: xcode8.3
221# os: osx
222#
223# # OSX GCC 4.6
224# - env: COMPILER=g++-4.6
225# compiler: gcc
226# osx_image: xcode6.4
227# os: osx
228#
229# # OSX GCC 4.7
230# - env: COMPILER=g++-4.7
231# compiler: gcc
232# osx_image: xcode6.4
233# os: osx
234#
235# # OSX GCC 4.8
236# - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
237# compiler: gcc
238# osx_image: xcode6.4
239# os: osx
240#
241# # OSX GCC 4.9
242# - env: COMPILER=g++-4.9 HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true # no ASAN_32 - errors when using ASAN_OPTIONS - probably g++ 4.9 bug
243# compiler: gcc
244# osx_image: xcode6.4
245# os: osx
246#
247# # OSX GCC 5
248# - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
249# compiler: gcc
250# osx_image: xcode7.3
251# os: osx
252#
253# # OSX GCC 6
254# - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
255# compiler: gcc
256# osx_image: xcode7.3
257# os: osx
258#
259# # OSX LLVM-GCC
260# - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true
261# compiler: gcc
262# os: osx
263#
264# allow_failures:
265#
266# # for some reason some of these builds fail sometimes...
267#
268# # OSX GCC 4.8
269# - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
270# compiler: gcc
271# osx_image: xcode6.4
272# os: osx
273#
274# # OSX GCC 6
275# - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
276# compiler: gcc
277# osx_image: xcode7.3
278# os: osx
onqtamb1a3de82016-10-10 22:22:00 +0300279
onqtame4c75fc2016-05-21 01:24:48 +0300280before_install:
onqtam2c8036f2016-06-26 17:12:42 +0300281 - git submodule update --init --recursive
282
283install:
onqtamf6d1a512017-05-01 13:56:12 +0300284 - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
285
onqtam01158572016-06-28 14:29:32 +0300286 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300287 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
288 ############################################################################
289
onqtam5a2b2552017-05-01 14:03:04 +0300290 # Make a dir for all
onqtamc7aaa962016-09-10 02:16:57 +0300291 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
292 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
293
onqtamc7aaa962016-09-10 02:16:57 +0300294 # Install a recent CMake
onqtamc7aaa962016-09-10 02:16:57 +0300295 - |
296 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
onqtam84015352017-03-15 20:11:07 +0200297 CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
onqtamc7aaa962016-09-10 02:16:57 +0300298 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
299 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
300 fi
301
onqtamc7aaa962016-09-10 02:16:57 +0300302 # Go back to ${TRAVIS_BUILD_DIR}
onqtamc7aaa962016-09-10 02:16:57 +0300303 - cd ${TRAVIS_BUILD_DIR}
304
305 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300306 # Install stuff with homebrew under OSX
307 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300308
onqtam23c6a342016-06-28 14:09:10 +0300309 - |
onqtame4c75fc2016-05-21 01:24:48 +0300310 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
311 brew update
312 # brew install ccache
onqtam27a8c082017-04-04 17:42:41 +0300313 # brew install valgrind
onqtame4c75fc2016-05-21 01:24:48 +0300314 # cmake
315 if brew list -1 | grep -q "^cmake\$"; then
316 brew outdated cmake || brew upgrade cmake
317 else
318 brew install cmake
319 fi
320 # gcc
onqtame4c75fc2016-05-21 01:24:48 +0300321 if [[ "${COMPILER}" = "g++-4.6" ]]; then
322 brew install gcc46
323 fi
324 if [[ "${COMPILER}" = "g++-4.7" ]]; then
325 brew install gcc47
326 fi
327 if [[ "${COMPILER}" = "g++-4.8" ]]; then
onqtamb1a3de82016-10-10 22:22:00 +0300328 brew install gcc48
onqtame4c75fc2016-05-21 01:24:48 +0300329 fi
330 if [[ "${COMPILER}" = "g++-4.9" ]]; then
331 brew install gcc49
332 fi
333 if [[ "${COMPILER}" = "g++-5" ]]; then
334 brew install gcc5
335 fi
336 if [[ "${COMPILER}" = "g++-6" ]]; then
337 brew install gcc6
338 fi
339 fi
onqtamf6d1a512017-05-01 13:56:12 +0300340
onqtame4c75fc2016-05-21 01:24:48 +0300341 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300342# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300343# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300344
345before_script:
346 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300347
348script:
349 # coverage - do not continue with other build configurations after that
350 - |
onqtamf6d1a512017-05-01 13:56:12 +0300351 if [[ "${CODE_COVERAGE}" = "true" ]]; then
onqtam76305352017-05-01 20:25:09 +0300352 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -std=c++98" -DCMAKE_BUILD_TYPE=Debug .
onqtamf6d1a512017-05-01 13:56:12 +0300353 make -k -j2
354 ctest --output-on-failure
onqtam5a2b2552017-05-01 14:03:04 +0300355
onqtamf6d1a512017-05-01 13:56:12 +0300356 lcov -d . -c -o coverage.info # parse coverage data
357 lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files
358 lcov -l coverage.info # just list a short summary of the results
359 coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info # upload results
onqtam5a2b2552017-05-01 14:03:04 +0300360
onqtame4c75fc2016-05-21 01:24:48 +0300361 exit
362 fi
363
onqtam0decb1d2017-04-30 19:37:29 +0300364 # static code analysis - do not continue with other build configurations after that
onqtam21623a62017-04-27 21:47:46 +0300365 - |
onqtam0decb1d2017-04-30 19:37:29 +0300366 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
367 # cppcheck
onqtam21623a62017-04-27 21:47:46 +0300368 cp doctest/doctest.h doctest.cpp
369 echo -e "TEST_CASE(\"\") {" >> doctest.cpp
370 echo -e " int a;" >> doctest.cpp
371 echo -e " SUBCASE(\"ouch\") a = 5;" >> doctest.cpp
372 echo -e " CAPTURE(a);" >> doctest.cpp
373 echo -e " CHECK(a == 6);" >> doctest.cpp
374 echo -e "}" >> doctest.cpp
onqtam5a2b2552017-05-01 14:03:04 +0300375
onqtamf1477ab2017-04-27 22:24:28 +0300376 cppcheck doctest.cpp --enable=all --suppress=unmatchedSuppression --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=functionConst --inline-suppr --platform=unix64 --inconclusive --std=posix --inconclusive -v --error-exitcode=1 --template "{file}({line}): {severity} ({id}): {message}" -DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
onqtam5a2b2552017-05-01 14:03:04 +0300377
onqtam0decb1d2017-04-30 19:37:29 +0300378 # clang-tidy
379 cd scripts/playground
380 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
381 clang-tidy-4.0 -p=. *.cpp -header-filter=.* -warnings-as-errors=* -checks='*,-misc-macro-parentheses,-misc-definitions-in-headers,-misc-unused-parameters,-llvm-header-guard,-llvm-include-order,-google-readability-braces-around-statements,-google-runtime-references,-google-readability-todo,-google-build-using-namespace,-google-explicit-constructor,-cert-err58-cpp,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-special-member-functions,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-type-member-init,-clang-analyzer-security.insecureAPI.strcpy,-modernize-use-nullptr,-modernize-use-equals-default,-modernize-loop-convert,-modernize-use-auto,-readability-braces-around-statements,-readability-named-parameter,-readability-else-after-return,-readability-redundant-declaration,-readability-implicit-bool-cast'
onqtam5a2b2552017-05-01 14:03:04 +0300382
onqtam21623a62017-04-27 21:47:46 +0300383 exit
384 fi
385
onqtame4c75fc2016-05-21 01:24:48 +0300386 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300387 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300388
onqtam1586ea22016-05-21 18:02:26 +0300389 # debug x64
onqtam56d91702017-04-16 21:03:58 +0300390 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300391 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300392 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
393 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300394 # release x64
onqtam56d91702017-04-16 21:03:58 +0300395 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300396 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300397 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
398 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300399 # debug x86
onqtam56d91702017-04-16 21:03:58 +0300400 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300401 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300402 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
403 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300404 # release x86
onqtam56d91702017-04-16 21:03:58 +0300405 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300406 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300407 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
408 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300409
410 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam56d91702017-04-16 21:03:58 +0300411 - cmake -DDOCTEST_TEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300412 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300413 # TODO: when this http://stackoverflow.com/questions/39081183 gets resolved - add these to ASAN as well: check_initialization_order=true:strict_init_order=true
onqtam56d91702017-04-16 21:03:58 +0300414 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi
415 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi
416 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi
417 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi
418 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
419 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
420 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
421 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
onqtame4c75fc2016-05-21 01:24:48 +0300422
onqtam7a3ad262017-03-18 18:05:10 +0200423 # test in c++0x mode - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300424 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" .
onqtam5cab8e92016-10-10 17:58:38 +0300425 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300426 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam5cab8e92016-10-10 17:58:38 +0300427
onqtam7a3ad262017-03-18 18:05:10 +0200428 # test without rtti - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300429 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" .
onqtamf63c5102017-02-25 20:00:52 +0200430 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300431 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtamf63c5102017-02-25 20:00:52 +0200432
onqtam7a3ad262017-03-18 18:05:10 +0200433 # test only compilation without exceptions - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300434 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-exceptions -DDOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS" .
onqtam2d93e042017-03-17 18:57:59 +0200435 - make clean && make -k -j2
436
onqtame4c75fc2016-05-21 01:24:48 +0300437# - ccache -s
438
onqtam2dd55282016-06-13 18:05:38 +0300439#after_script:
440# - cat compile_commands.json