blob: 1a35b34f56e4836ce78a5af744a3ae57d474e3ee [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"
onqtama0e136f2017-05-15 20:47:49 +0300145 dist: trusty
onqtamaec53d22017-05-03 06:29:47 +0300146 compiler: gcc
147 addons: &gcc7
148 apt:
149 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
150 sources: *apt_sources
151
152 # Clang 3.4
153 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
154 addons: &clang
155 apt:
156 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
157 sources: *apt_sources
158
159 # Clang 3.5
160 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
161 addons: &clang35
162 apt:
163 packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
164 sources: *apt_sources
165
166 # Clang 3.6
167 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
168 addons: &clang36
169 apt:
170 packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
171 sources: *apt_sources
172
173 # Clang 3.7
174 - env: COMPILER=clang++-3.7
175 addons: &clang37
176 apt:
177 packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
178 sources: *apt_sources
179
180 # Clang 3.8
181 - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true
182 addons: &clang38
183 apt:
184 packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
185 sources: *apt_sources
186
187 # Clang 3.9
188 - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
189 addons: &clang39
190 apt:
191 packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
192 sources: *apt_sources
193
194 # Clang 4.0
195 - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
196 dist: trusty
197 addons: &clang40
198 apt:
199 packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
200 sources: *apt_sources
201
202 # Xcode 6.4 Clang
203 - env: COMPILER=clang++
204 osx_image: xcode6.4
205 os: osx
206
207 # Xcode 7.3 Clang
208 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
209 osx_image: xcode7.3
210 os: osx
211
212 # Xcode 8 Clang
213 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
214 osx_image: xcode8
215 os: osx
216
217 # Xcode 8.1 Clang
218 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
219 osx_image: xcode8.1
220 os: osx
221
222 # Xcode 8.2 Clang
223 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
224 osx_image: xcode8.2
225 os: osx
226
227 # Xcode 8.3 Clang
228 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
229 osx_image: xcode8.3
230 os: osx
231
232 # OSX GCC 4.6
233 - env: COMPILER=g++-4.6
234 compiler: gcc
235 osx_image: xcode6.4
236 os: osx
237
238 # OSX GCC 4.7
239 - env: COMPILER=g++-4.7
240 compiler: gcc
241 osx_image: xcode6.4
242 os: osx
243
244 # OSX GCC 4.8
245 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
246 compiler: gcc
247 osx_image: xcode6.4
248 os: osx
249
250 # OSX GCC 4.9
251 - 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
252 compiler: gcc
253 osx_image: xcode6.4
254 os: osx
255
256 # OSX GCC 5
257 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
258 compiler: gcc
259 osx_image: xcode7.3
260 os: osx
261
262 # OSX GCC 6
263 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
264 compiler: gcc
265 osx_image: xcode7.3
266 os: osx
267
268 # OSX GCC 7
269 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
270 compiler: gcc
271 osx_image: xcode7.3
272 os: osx
273
274 # OSX LLVM-GCC
275 - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true
276 compiler: gcc
277 os: osx
278
279 allow_failures:
280
281 # GCC 7
282 - 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"
onqtama0e136f2017-05-15 20:47:49 +0300283 dist: trusty
onqtamaec53d22017-05-03 06:29:47 +0300284 compiler: gcc
285 addons: &gcc7
286 apt:
287 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
288 sources: *apt_sources
289
290 # OSX GCC 4.8
291 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
292 compiler: gcc
293 osx_image: xcode6.4
294 os: osx
295
296 # OSX GCC 6
297 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
298 compiler: gcc
299 osx_image: xcode7.3
300 os: osx
301
302 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
303 compiler: gcc
304 osx_image: xcode7.3
305 os: osx
onqtamb1a3de82016-10-10 22:22:00 +0300306
onqtam2c8036f2016-06-26 17:12:42 +0300307install:
onqtamf6d1a512017-05-01 13:56:12 +0300308 - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
309
onqtam01158572016-06-28 14:29:32 +0300310 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300311 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
312 ############################################################################
313
onqtam5a2b2552017-05-01 14:03:04 +0300314 # Make a dir for all
onqtamc7aaa962016-09-10 02:16:57 +0300315 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
316 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
317
onqtamc7aaa962016-09-10 02:16:57 +0300318 # Install a recent CMake
onqtamc7aaa962016-09-10 02:16:57 +0300319 - |
320 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
onqtam84015352017-03-15 20:11:07 +0200321 CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
onqtamc7aaa962016-09-10 02:16:57 +0300322 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
323 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
324 fi
325
onqtamebc7da32017-05-13 21:33:19 +0300326 # Install OCLint
327 - |
328 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
329 OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz"
330 mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint
331 export PATH=${DEPS_DIR}/oclint/bin:${PATH}
332 fi
333
onqtamc7aaa962016-09-10 02:16:57 +0300334 # Go back to ${TRAVIS_BUILD_DIR}
onqtamc7aaa962016-09-10 02:16:57 +0300335 - cd ${TRAVIS_BUILD_DIR}
336
337 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300338 # Install stuff with homebrew under OSX
339 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300340
onqtam23c6a342016-06-28 14:09:10 +0300341 - |
onqtame4c75fc2016-05-21 01:24:48 +0300342 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
343 brew update
344 # brew install ccache
onqtam27a8c082017-04-04 17:42:41 +0300345 # brew install valgrind
onqtame4c75fc2016-05-21 01:24:48 +0300346 # cmake
347 if brew list -1 | grep -q "^cmake\$"; then
348 brew outdated cmake || brew upgrade cmake
349 else
350 brew install cmake
351 fi
352 # gcc
onqtame4c75fc2016-05-21 01:24:48 +0300353 if [[ "${COMPILER}" = "g++-4.6" ]]; then
354 brew install gcc46
355 fi
356 if [[ "${COMPILER}" = "g++-4.7" ]]; then
357 brew install gcc47
358 fi
359 if [[ "${COMPILER}" = "g++-4.8" ]]; then
onqtamb1a3de82016-10-10 22:22:00 +0300360 brew install gcc48
onqtame4c75fc2016-05-21 01:24:48 +0300361 fi
362 if [[ "${COMPILER}" = "g++-4.9" ]]; then
363 brew install gcc49
364 fi
365 if [[ "${COMPILER}" = "g++-5" ]]; then
366 brew install gcc5
367 fi
368 if [[ "${COMPILER}" = "g++-6" ]]; then
369 brew install gcc6
370 fi
onqtamaab98c52017-05-02 19:48:42 +0300371 if [[ "${COMPILER}" = "g++-7" ]]; then
372 brew install gcc7
373 fi
onqtame4c75fc2016-05-21 01:24:48 +0300374 fi
onqtamf6d1a512017-05-01 13:56:12 +0300375
onqtame4c75fc2016-05-21 01:24:48 +0300376 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300377# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300378# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300379
380before_script:
381 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300382
383script:
onqtam81eab5e2017-05-08 11:51:20 +0300384 # coverage
onqtame4c75fc2016-05-21 01:24:48 +0300385 - |
onqtamf6d1a512017-05-01 13:56:12 +0300386 if [[ "${CODE_COVERAGE}" = "true" ]]; then
onqtam81eab5e2017-05-08 11:51:20 +0300387 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
388 make -k -j2 || exit 1
389 ctest --output-on-failure || exit 1
390
onqtamf6d1a512017-05-01 13:56:12 +0300391 lcov -d . -c -o coverage.info # parse coverage data
392 lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files
393 lcov -l coverage.info # just list a short summary of the results
394 coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info # upload results
onqtam5a2b2552017-05-01 14:03:04 +0300395
onqtam81eab5e2017-05-08 11:51:20 +0300396 # do not continue with other build configurations after that
onqtame4c75fc2016-05-21 01:24:48 +0300397 exit
398 fi
399
onqtam81eab5e2017-05-08 11:51:20 +0300400 # static code analysis
onqtam21623a62017-04-27 21:47:46 +0300401 - |
onqtam0decb1d2017-04-30 19:37:29 +0300402 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
onqtamebc7da32017-05-13 21:33:19 +0300403 # setup a test file "doctest.cpp" that is the header + a test case at the end
404 echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp
405 cat doctest/doctest.h >> doctest.cpp
onqtamc2b6e132017-05-08 16:37:31 +0300406 echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp
407
onqtamebc7da32017-05-13 21:33:19 +0300408 # cppcheck
409 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}"
410
411 # oclint
412 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 +0300413
414 # clang-tidy
415 cd scripts/playground
onqtamc2b6e132017-05-08 16:37:31 +0300416 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1
onqtamfdd233c2017-05-09 20:24:32 +0300417 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 +0300418
419 # do not continue with other build configurations after that
420 exit
421 fi
onqtam21623a62017-04-27 21:47:46 +0300422
onqtame4c75fc2016-05-21 01:24:48 +0300423 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300424 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300425
onqtam1586ea22016-05-21 18:02:26 +0300426 # debug x64
onqtam56d91702017-04-16 21:03:58 +0300427 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300428 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300429 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
430 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300431 # release x64
onqtam56d91702017-04-16 21:03:58 +0300432 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300433 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300434 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
435 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300436 # debug x86
onqtam56d91702017-04-16 21:03:58 +0300437 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300438 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300439 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
440 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300441 # release x86
onqtam56d91702017-04-16 21:03:58 +0300442 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300443 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300444 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
445 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300446
447 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam56d91702017-04-16 21:03:58 +0300448 - cmake -DDOCTEST_TEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300449 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300450 # 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 +0300451 - 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
452 - 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
453 - 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
454 - 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
455 - 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
456 - 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
457 - 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
458 - 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 +0300459
onqtam7a3ad262017-03-18 18:05:10 +0200460 # test in c++0x mode - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300461 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" .
onqtam5cab8e92016-10-10 17:58:38 +0300462 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300463 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam5cab8e92016-10-10 17:58:38 +0300464
onqtam7a3ad262017-03-18 18:05:10 +0200465 # test without rtti - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300466 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" .
onqtamf63c5102017-02-25 20:00:52 +0200467 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300468 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtamf63c5102017-02-25 20:00:52 +0200469
onqtam7a3ad262017-03-18 18:05:10 +0200470 # test only compilation without exceptions - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300471 - 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 +0200472 - make clean && make -k -j2
473
onqtame4c75fc2016-05-21 01:24:48 +0300474# - ccache -s
475
onqtam2dd55282016-06-13 18:05:38 +0300476#after_script:
477# - cat compile_commands.json