blob: a0343f4dda41979bae2b0068eef48420a5d306e5 [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
onqtamaec53d22017-05-03 06:29:47 +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 # GCC 7
144 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold"
145 compiler: gcc
146 addons: &gcc7
147 apt:
148 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
149 sources: *apt_sources
150
151 # Clang 3.4
152 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
153 addons: &clang
154 apt:
155 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
156 sources: *apt_sources
157
158 # Clang 3.5
159 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
160 addons: &clang35
161 apt:
162 packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
163 sources: *apt_sources
164
165 # Clang 3.6
166 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
167 addons: &clang36
168 apt:
169 packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
170 sources: *apt_sources
171
172 # Clang 3.7
173 - env: COMPILER=clang++-3.7
174 addons: &clang37
175 apt:
176 packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
177 sources: *apt_sources
178
179 # Clang 3.8
180 - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true
181 addons: &clang38
182 apt:
183 packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
184 sources: *apt_sources
185
186 # Clang 3.9
187 - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
188 addons: &clang39
189 apt:
190 packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
191 sources: *apt_sources
192
193 # Clang 4.0
194 - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
195 dist: trusty
196 addons: &clang40
197 apt:
198 packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
199 sources: *apt_sources
200
201 # Xcode 6.4 Clang
202 - env: COMPILER=clang++
203 osx_image: xcode6.4
204 os: osx
205
206 # Xcode 7.3 Clang
207 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
208 osx_image: xcode7.3
209 os: osx
210
211 # Xcode 8 Clang
212 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
213 osx_image: xcode8
214 os: osx
215
216 # Xcode 8.1 Clang
217 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
218 osx_image: xcode8.1
219 os: osx
220
221 # Xcode 8.2 Clang
222 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
223 osx_image: xcode8.2
224 os: osx
225
226 # Xcode 8.3 Clang
227 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
228 osx_image: xcode8.3
229 os: osx
230
231 # OSX GCC 4.6
232 - env: COMPILER=g++-4.6
233 compiler: gcc
234 osx_image: xcode6.4
235 os: osx
236
237 # OSX GCC 4.7
238 - env: COMPILER=g++-4.7
239 compiler: gcc
240 osx_image: xcode6.4
241 os: osx
242
243 # OSX GCC 4.8
244 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
245 compiler: gcc
246 osx_image: xcode6.4
247 os: osx
248
249 # OSX GCC 4.9
250 - 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
251 compiler: gcc
252 osx_image: xcode6.4
253 os: osx
254
255 # OSX GCC 5
256 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
257 compiler: gcc
258 osx_image: xcode7.3
259 os: osx
260
261 # OSX GCC 6
262 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
263 compiler: gcc
264 osx_image: xcode7.3
265 os: osx
266
267 # OSX GCC 7
268 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
269 compiler: gcc
270 osx_image: xcode7.3
271 os: osx
272
273 # OSX LLVM-GCC
274 - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true
275 compiler: gcc
276 os: osx
277
278 allow_failures:
279
280 # GCC 7
281 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold"
282 compiler: gcc
283 addons: &gcc7
284 apt:
285 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
286 sources: *apt_sources
287
288 # OSX GCC 4.8
289 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
290 compiler: gcc
291 osx_image: xcode6.4
292 os: osx
293
294 # OSX GCC 6
295 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
296 compiler: gcc
297 osx_image: xcode7.3
298 os: osx
299
300 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
301 compiler: gcc
302 osx_image: xcode7.3
303 os: osx
onqtamb1a3de82016-10-10 22:22:00 +0300304
onqtame4c75fc2016-05-21 01:24:48 +0300305before_install:
onqtam2c8036f2016-06-26 17:12:42 +0300306 - git submodule update --init --recursive
307
308install:
onqtamf6d1a512017-05-01 13:56:12 +0300309 - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
310
onqtam01158572016-06-28 14:29:32 +0300311 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300312 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
313 ############################################################################
314
onqtam5a2b2552017-05-01 14:03:04 +0300315 # Make a dir for all
onqtamc7aaa962016-09-10 02:16:57 +0300316 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
317 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
318
onqtamc7aaa962016-09-10 02:16:57 +0300319 # Install a recent CMake
onqtamc7aaa962016-09-10 02:16:57 +0300320 - |
321 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
onqtam84015352017-03-15 20:11:07 +0200322 CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
onqtamc7aaa962016-09-10 02:16:57 +0300323 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
324 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
325 fi
326
onqtamc7aaa962016-09-10 02:16:57 +0300327 # Go back to ${TRAVIS_BUILD_DIR}
onqtamc7aaa962016-09-10 02:16:57 +0300328 - cd ${TRAVIS_BUILD_DIR}
329
330 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300331 # Install stuff with homebrew under OSX
332 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300333
onqtam23c6a342016-06-28 14:09:10 +0300334 - |
onqtame4c75fc2016-05-21 01:24:48 +0300335 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
336 brew update
337 # brew install ccache
onqtam27a8c082017-04-04 17:42:41 +0300338 # brew install valgrind
onqtame4c75fc2016-05-21 01:24:48 +0300339 # cmake
340 if brew list -1 | grep -q "^cmake\$"; then
341 brew outdated cmake || brew upgrade cmake
342 else
343 brew install cmake
344 fi
345 # gcc
onqtame4c75fc2016-05-21 01:24:48 +0300346 if [[ "${COMPILER}" = "g++-4.6" ]]; then
347 brew install gcc46
348 fi
349 if [[ "${COMPILER}" = "g++-4.7" ]]; then
350 brew install gcc47
351 fi
352 if [[ "${COMPILER}" = "g++-4.8" ]]; then
onqtamb1a3de82016-10-10 22:22:00 +0300353 brew install gcc48
onqtame4c75fc2016-05-21 01:24:48 +0300354 fi
355 if [[ "${COMPILER}" = "g++-4.9" ]]; then
356 brew install gcc49
357 fi
358 if [[ "${COMPILER}" = "g++-5" ]]; then
359 brew install gcc5
360 fi
361 if [[ "${COMPILER}" = "g++-6" ]]; then
362 brew install gcc6
363 fi
onqtamaab98c52017-05-02 19:48:42 +0300364 if [[ "${COMPILER}" = "g++-7" ]]; then
365 brew install gcc7
366 fi
onqtame4c75fc2016-05-21 01:24:48 +0300367 fi
onqtamf6d1a512017-05-01 13:56:12 +0300368
onqtame4c75fc2016-05-21 01:24:48 +0300369 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300370# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300371# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300372
373before_script:
374 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300375
376script:
377 # coverage - do not continue with other build configurations after that
378 - |
onqtamf6d1a512017-05-01 13:56:12 +0300379 if [[ "${CODE_COVERAGE}" = "true" ]]; then
onqtam76305352017-05-01 20:25:09 +0300380 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 +0300381 make -k -j2
382 ctest --output-on-failure
onqtam5a2b2552017-05-01 14:03:04 +0300383
onqtamf6d1a512017-05-01 13:56:12 +0300384 lcov -d . -c -o coverage.info # parse coverage data
385 lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files
386 lcov -l coverage.info # just list a short summary of the results
387 coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info # upload results
onqtam5a2b2552017-05-01 14:03:04 +0300388
onqtame4c75fc2016-05-21 01:24:48 +0300389 exit
390 fi
391
onqtam0decb1d2017-04-30 19:37:29 +0300392 # static code analysis - do not continue with other build configurations after that
onqtam21623a62017-04-27 21:47:46 +0300393 - |
onqtam0decb1d2017-04-30 19:37:29 +0300394 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
395 # cppcheck
onqtam21623a62017-04-27 21:47:46 +0300396 cp doctest/doctest.h doctest.cpp
397 echo -e "TEST_CASE(\"\") {" >> doctest.cpp
398 echo -e " int a;" >> doctest.cpp
399 echo -e " SUBCASE(\"ouch\") a = 5;" >> doctest.cpp
400 echo -e " CAPTURE(a);" >> doctest.cpp
401 echo -e " CHECK(a == 6);" >> doctest.cpp
402 echo -e "}" >> doctest.cpp
onqtam5a2b2552017-05-01 14:03:04 +0300403
onqtamf1477ab2017-04-27 22:24:28 +0300404 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 +0300405
onqtam0decb1d2017-04-30 19:37:29 +0300406 # clang-tidy
407 cd scripts/playground
408 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
409 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 +0300410
onqtam21623a62017-04-27 21:47:46 +0300411 exit
412 fi
413
onqtame4c75fc2016-05-21 01:24:48 +0300414 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300415 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300416
onqtam1586ea22016-05-21 18:02:26 +0300417 # debug x64
onqtam56d91702017-04-16 21:03:58 +0300418 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300419 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300420 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
421 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300422 # release x64
onqtam56d91702017-04-16 21:03:58 +0300423 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300424 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300425 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
426 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300427 # debug x86
onqtam56d91702017-04-16 21:03:58 +0300428 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300429 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300430 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
431 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300432 # release x86
onqtam56d91702017-04-16 21:03:58 +0300433 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300434 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300435 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
436 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300437
438 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam56d91702017-04-16 21:03:58 +0300439 - cmake -DDOCTEST_TEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300440 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300441 # 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 +0300442 - 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
443 - 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
444 - 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
445 - 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
446 - 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
447 - 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
448 - 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
449 - 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 +0300450
onqtam7a3ad262017-03-18 18:05:10 +0200451 # test in c++0x mode - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300452 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" .
onqtam5cab8e92016-10-10 17:58:38 +0300453 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300454 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam5cab8e92016-10-10 17:58:38 +0300455
onqtam7a3ad262017-03-18 18:05:10 +0200456 # test without rtti - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300457 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" .
onqtamf63c5102017-02-25 20:00:52 +0200458 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300459 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtamf63c5102017-02-25 20:00:52 +0200460
onqtam7a3ad262017-03-18 18:05:10 +0200461 # test only compilation without exceptions - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300462 - 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 +0200463 - make clean && make -k -j2
464
onqtame4c75fc2016-05-21 01:24:48 +0300465# - ccache -s
466
onqtam2dd55282016-06-13 18:05:38 +0300467#after_script:
468# - cat compile_commands.json