blob: 83253daa43095ac0a9b47489b5082383f4f42214 [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
onqtam92a9ce12017-05-29 23:56:22 +030040 build_command: clang++ scripts/hello_world.cpp -I doctest
onqtame4c75fc2016-05-21 01:24:48 +030041 branch_pattern: coverity_scan
42 # these apt sources will be referenced later (by using *name)
43 apt:
onqtam2c8036f2016-06-26 17:12:42 +030044 sources: &apt_sources
45 - ubuntu-toolchain-r-test
onqtam7e775f92016-11-15 02:41:10 +020046 - llvm-toolchain-precise
onqtamb382bd32016-08-01 20:53:56 +030047 - llvm-toolchain-precise-3.5
48 - llvm-toolchain-precise-3.6
49 - llvm-toolchain-precise-3.7
50 - llvm-toolchain-precise-3.8
onqtamfd62aa02016-11-15 03:00:44 +020051 - llvm-toolchain-precise-3.9
onqtam3bf83c42017-04-23 15:30:23 +030052 - llvm-toolchain-trusty
53 - llvm-toolchain-trusty-4.0
onqtame4c75fc2016-05-21 01:24:48 +030054
55compiler: clang
56os: linux
57
58matrix:
59 exclude:
60 - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
61
62 include:
onqtamd1737e42016-08-01 19:05:07 +030063 # coverage
onqtamf6d1a512017-05-01 13:56:12 +030064 - env: COMPILER=g++ CODE_COVERAGE=true
onqtamd1737e42016-08-01 19:05:07 +030065 compiler: gcc
66 addons:
67 apt:
onqtamf6d1a512017-05-01 13:56:12 +030068 packages: ["lcov"]
onqtamd1737e42016-08-01 19:05:07 +030069
onqtamaec53d22017-05-03 06:29:47 +030070 # static code analysis
71 - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true
72 dist: trusty
73 addons: &clang40
74 apt:
75 packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"]
76 sources: *apt_sources
77
78 # GCC 4.4
79 - env: COMPILER=g++-4.4
80 compiler: gcc
81 addons: &gcc44
82 apt:
83 packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"]
84 sources: *apt_sources
85
86 # GCC 4.5
87 - env: COMPILER=g++-4.5
88 compiler: gcc
89 addons: &gcc45
90 apt:
91 packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"]
92 sources: *apt_sources
93
94 # GCC 4.6
95 - env: COMPILER=g++-4.6
96 compiler: gcc
97 addons: &gcc46
98 apt:
99 packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"]
100 sources: *apt_sources
101
102 # GCC 4.7
103 - env: COMPILER=g++-4.7
104 compiler: gcc
105 addons: &gcc47
106 apt:
107 packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"]
108 sources: *apt_sources
109
110 # GCC 4.8
111 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
112 compiler: gcc
113 addons: &gcc48
114 apt:
115 packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
116 sources: *apt_sources
117
118 # GCC 4.9
119 - 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
120 compiler: gcc
121 addons: &gcc49
122 apt:
123 packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
124 sources: *apt_sources
125
126 # GCC 5
127 - 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"
128 compiler: gcc
129 addons: &gcc5
130 apt:
131 packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
132 sources: *apt_sources
133
134 # GCC 6
135 - 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"
136 compiler: gcc
137 addons: &gcc6
138 apt:
139 packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
140 sources: *apt_sources
141
142 # GCC 7
143 - 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"
144 compiler: gcc
145 addons: &gcc7
146 apt:
147 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
148 sources: *apt_sources
149
150 # Clang 3.4
151 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
152 addons: &clang
153 apt:
154 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
155 sources: *apt_sources
156
157 # Clang 3.5
158 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
159 addons: &clang35
160 apt:
161 packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
162 sources: *apt_sources
163
164 # Clang 3.6
165 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
166 addons: &clang36
167 apt:
168 packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
169 sources: *apt_sources
170
171 # Clang 3.7
172 - env: COMPILER=clang++-3.7
173 addons: &clang37
174 apt:
175 packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
176 sources: *apt_sources
177
178 # Clang 3.8
179 - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true
180 addons: &clang38
181 apt:
182 packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
183 sources: *apt_sources
184
185 # Clang 3.9
186 - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
187 addons: &clang39
188 apt:
189 packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
190 sources: *apt_sources
191
192 # Clang 4.0
193 - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
194 dist: trusty
195 addons: &clang40
196 apt:
197 packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
198 sources: *apt_sources
199
200 # Xcode 6.4 Clang
201 - env: COMPILER=clang++
202 osx_image: xcode6.4
203 os: osx
204
205 # Xcode 7.3 Clang
206 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
207 osx_image: xcode7.3
208 os: osx
209
210 # Xcode 8 Clang
211 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
212 osx_image: xcode8
213 os: osx
214
215 # Xcode 8.1 Clang
216 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
217 osx_image: xcode8.1
218 os: osx
219
220 # Xcode 8.2 Clang
221 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
222 osx_image: xcode8.2
223 os: osx
224
225 # Xcode 8.3 Clang
226 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
227 osx_image: xcode8.3
228 os: osx
229
230 # OSX GCC 4.6
231 - env: COMPILER=g++-4.6
232 compiler: gcc
233 osx_image: xcode6.4
234 os: osx
235
236 # OSX GCC 4.7
237 - env: COMPILER=g++-4.7
238 compiler: gcc
239 osx_image: xcode6.4
240 os: osx
241
242 # OSX GCC 4.8
243 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
244 compiler: gcc
245 osx_image: xcode6.4
246 os: osx
247
248 # OSX GCC 4.9
249 - 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
250 compiler: gcc
251 osx_image: xcode6.4
252 os: osx
253
254 # OSX GCC 5
255 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
256 compiler: gcc
257 osx_image: xcode7.3
258 os: osx
259
260 # OSX GCC 6
261 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
262 compiler: gcc
263 osx_image: xcode7.3
264 os: osx
265
266 # OSX GCC 7
267 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
268 compiler: gcc
269 osx_image: xcode7.3
270 os: osx
271
272 # OSX LLVM-GCC
273 - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true
274 compiler: gcc
275 os: osx
276
277 allow_failures:
278
279 # GCC 7
280 - 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"
281 compiler: gcc
282 addons: &gcc7
283 apt:
284 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
285 sources: *apt_sources
286
287 # OSX GCC 4.8
288 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
289 compiler: gcc
290 osx_image: xcode6.4
291 os: osx
292
293 # OSX GCC 6
294 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
295 compiler: gcc
296 osx_image: xcode7.3
297 os: osx
298
299 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
300 compiler: gcc
301 osx_image: xcode7.3
302 os: osx
onqtamb1a3de82016-10-10 22:22:00 +0300303
onqtam2c8036f2016-06-26 17:12:42 +0300304install:
onqtamf6d1a512017-05-01 13:56:12 +0300305 - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
306
onqtam01158572016-06-28 14:29:32 +0300307 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300308 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
309 ############################################################################
310
onqtam5a2b2552017-05-01 14:03:04 +0300311 # Make a dir for all
onqtamc7aaa962016-09-10 02:16:57 +0300312 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
313 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
314
onqtamc7aaa962016-09-10 02:16:57 +0300315 # Install a recent CMake
onqtamc7aaa962016-09-10 02:16:57 +0300316 - |
317 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
onqtam84015352017-03-15 20:11:07 +0200318 CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
onqtamc7aaa962016-09-10 02:16:57 +0300319 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
320 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
321 fi
322
onqtamebc7da32017-05-13 21:33:19 +0300323 # Install OCLint
324 - |
325 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
326 OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz"
327 mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint
328 export PATH=${DEPS_DIR}/oclint/bin:${PATH}
329 fi
330
onqtamc7aaa962016-09-10 02:16:57 +0300331 # Go back to ${TRAVIS_BUILD_DIR}
onqtamc7aaa962016-09-10 02:16:57 +0300332 - cd ${TRAVIS_BUILD_DIR}
333
334 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300335 # Install stuff with homebrew under OSX
336 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300337
onqtam23c6a342016-06-28 14:09:10 +0300338 - |
onqtame4c75fc2016-05-21 01:24:48 +0300339 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
340 brew update
341 # brew install ccache
onqtam27a8c082017-04-04 17:42:41 +0300342 # brew install valgrind
onqtame4c75fc2016-05-21 01:24:48 +0300343 # cmake
344 if brew list -1 | grep -q "^cmake\$"; then
345 brew outdated cmake || brew upgrade cmake
346 else
347 brew install cmake
348 fi
349 # gcc
onqtame4c75fc2016-05-21 01:24:48 +0300350 if [[ "${COMPILER}" = "g++-4.6" ]]; then
351 brew install gcc46
352 fi
353 if [[ "${COMPILER}" = "g++-4.7" ]]; then
354 brew install gcc47
355 fi
356 if [[ "${COMPILER}" = "g++-4.8" ]]; then
onqtamb1a3de82016-10-10 22:22:00 +0300357 brew install gcc48
onqtame4c75fc2016-05-21 01:24:48 +0300358 fi
359 if [[ "${COMPILER}" = "g++-4.9" ]]; then
360 brew install gcc49
361 fi
362 if [[ "${COMPILER}" = "g++-5" ]]; then
363 brew install gcc5
364 fi
365 if [[ "${COMPILER}" = "g++-6" ]]; then
366 brew install gcc6
367 fi
onqtamaab98c52017-05-02 19:48:42 +0300368 if [[ "${COMPILER}" = "g++-7" ]]; then
369 brew install gcc7
370 fi
onqtame4c75fc2016-05-21 01:24:48 +0300371 fi
onqtamf6d1a512017-05-01 13:56:12 +0300372
onqtame4c75fc2016-05-21 01:24:48 +0300373 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300374# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300375# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300376
377before_script:
378 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300379
380script:
onqtam81eab5e2017-05-08 11:51:20 +0300381 # coverage
onqtame4c75fc2016-05-21 01:24:48 +0300382 - |
onqtamf6d1a512017-05-01 13:56:12 +0300383 if [[ "${CODE_COVERAGE}" = "true" ]]; then
onqtam81eab5e2017-05-08 11:51:20 +0300384 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -std=c++98" -DCMAKE_BUILD_TYPE=Debug . || exit 1
385 make -k -j2 || exit 1
386 ctest --output-on-failure || exit 1
387
onqtamf6d1a512017-05-01 13:56:12 +0300388 lcov -d . -c -o coverage.info # parse coverage data
389 lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files
390 lcov -l coverage.info # just list a short summary of the results
391 coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info # upload results
onqtam5a2b2552017-05-01 14:03:04 +0300392
onqtam81eab5e2017-05-08 11:51:20 +0300393 # do not continue with other build configurations after that
onqtame4c75fc2016-05-21 01:24:48 +0300394 exit
395 fi
396
onqtam81eab5e2017-05-08 11:51:20 +0300397 # static code analysis
onqtam21623a62017-04-27 21:47:46 +0300398 - |
onqtam0decb1d2017-04-30 19:37:29 +0300399 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
onqtamebc7da32017-05-13 21:33:19 +0300400 # setup a test file "doctest.cpp" that is the header + a test case at the end
401 echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp
402 cat doctest/doctest.h >> doctest.cpp
onqtamc2b6e132017-05-08 16:37:31 +0300403 echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp
404
onqtamebc7da32017-05-13 21:33:19 +0300405 # cppcheck
406 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}"
407
408 # oclint
409 oclint doctest.cpp -disable-rule=ShortVariableName -disable-rule=LongLine -disable-rule=LongMethod -disable-rule=HighNcssMethod -disable-rule=LongVariableName -disable-rule=HighCyclomaticComplexity -disable-rule=HighNPathComplexity -disable-rule=UnusedLocalVariable -disable-rule=DoubleNegative -disable-rule=MultipleUnaryOperator -disable-rule=DeepNestedBlock || exit 1
onqtam81eab5e2017-05-08 11:51:20 +0300410
411 # clang-tidy
412 cd scripts/playground
onqtamc2b6e132017-05-08 16:37:31 +0300413 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1
onqtamfdd233c2017-05-09 20:24:32 +0300414 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,-cppcoreguidelines-pro-type-union-access,-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' || exit 1
onqtam81eab5e2017-05-08 11:51:20 +0300415
416 # do not continue with other build configurations after that
417 exit
418 fi
onqtam21623a62017-04-27 21:47:46 +0300419
onqtame4c75fc2016-05-21 01:24:48 +0300420 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300421 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300422
onqtam1586ea22016-05-21 18:02:26 +0300423 # debug x64
onqtam56d91702017-04-16 21:03:58 +0300424 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300425 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300426 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
427 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300428 # release x64
onqtam56d91702017-04-16 21:03:58 +0300429 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300430 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300431 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
432 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300433 # debug x86
onqtam56d91702017-04-16 21:03:58 +0300434 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300435 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300436 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
437 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300438 # release x86
onqtam56d91702017-04-16 21:03:58 +0300439 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300440 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300441 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
442 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300443
444 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam56d91702017-04-16 21:03:58 +0300445 - cmake -DDOCTEST_TEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300446 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300447 # 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 +0300448 - 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
449 - 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
450 - 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
451 - 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
452 - 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
453 - 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
454 - 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
455 - 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 +0300456
onqtam7a3ad262017-03-18 18:05:10 +0200457 # test in c++0x mode - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300458 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" .
onqtam5cab8e92016-10-10 17:58:38 +0300459 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300460 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam5cab8e92016-10-10 17:58:38 +0300461
onqtam7a3ad262017-03-18 18:05:10 +0200462 # test without rtti - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300463 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" .
onqtamf63c5102017-02-25 20:00:52 +0200464 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300465 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtamf63c5102017-02-25 20:00:52 +0200466
onqtam7a3ad262017-03-18 18:05:10 +0200467 # test only compilation without exceptions - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300468 - 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 +0200469 - make clean && make -k -j2
470
onqtame4c75fc2016-05-21 01:24:48 +0300471# - ccache -s
472
onqtam2dd55282016-06-13 18:05:38 +0300473#after_script:
474# - cat compile_commands.json