blob: 50d9864043ba8f90158365519aa92463e2bad06b [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
onqtam803bb8f2017-09-05 13:00:24 +03003dist: trusty
onqtame4c75fc2016-05-21 01:24:48 +03004sudo: false
5language: c++
6
7notifications:
onqtamf5169772016-09-09 18:33:13 +03008 email: false
onqtame4c75fc2016-05-21 01:24:48 +03009 # gitter
10 webhooks:
11 urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706
12 on_success: change
13 on_failure: always
14git:
onqtam9f934f82016-08-02 12:42:19 +030015 depth: 500
onqtame4c75fc2016-05-21 01:24:48 +030016
17# both apt and ccache make the builds slower...
18#cache:
19# - apt
20# - ccache
21
22env:
23 global:
24# - USE_CCACHE=1
25# - CCACHE_SLOPPINESS=pch_defines,time_macros
26# - CCACHE_COMPRESS=1
27# - CCACHE_MAXSIZE=200M
28# - CCACHE_CPP2=1
29 - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
onqtame4c75fc2016-05-21 01:24:48 +030030
31addons:
32 coverity_scan:
33 # COVERITY_SCAN_TOKEN added as env var in travis project
34 project:
35 name: onqtam/doctest
36 notification_email: vik.kirilov@gmail.com
onqtam92a9ce12017-05-29 23:56:22 +030037 build_command: clang++ scripts/hello_world.cpp -I doctest
onqtame4c75fc2016-05-21 01:24:48 +030038 branch_pattern: coverity_scan
39 # these apt sources will be referenced later (by using *name)
40 apt:
onqtam2c8036f2016-06-26 17:12:42 +030041 sources: &apt_sources
42 - ubuntu-toolchain-r-test
onqtam3bf83c42017-04-23 15:30:23 +030043 - llvm-toolchain-trusty
onqtam803bb8f2017-09-05 13:00:24 +030044 - llvm-toolchain-trusty-3.9
onqtam3bf83c42017-04-23 15:30:23 +030045 - llvm-toolchain-trusty-4.0
onqtam803bb8f2017-09-05 13:00:24 +030046 - llvm-toolchain-trusty-5.0
onqtame4c75fc2016-05-21 01:24:48 +030047
48compiler: clang
49os: linux
50
51matrix:
onqtame4c75fc2016-05-21 01:24:48 +030052 include:
onqtamd1737e42016-08-01 19:05:07 +030053 # coverage
onqtamf6d1a512017-05-01 13:56:12 +030054 - env: COMPILER=g++ CODE_COVERAGE=true
onqtamd1737e42016-08-01 19:05:07 +030055 compiler: gcc
56 addons:
57 apt:
onqtamf6d1a512017-05-01 13:56:12 +030058 packages: ["lcov"]
onqtamd1737e42016-08-01 19:05:07 +030059
onqtamaec53d22017-05-03 06:29:47 +030060 # static code analysis
61 - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true
onqtamaec53d22017-05-03 06:29:47 +030062 addons: &clang40
63 apt:
64 packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"]
65 sources: *apt_sources
66
67 # GCC 4.4
68 - env: COMPILER=g++-4.4
69 compiler: gcc
70 addons: &gcc44
71 apt:
72 packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"]
73 sources: *apt_sources
74
75 # GCC 4.5
76 - env: COMPILER=g++-4.5
77 compiler: gcc
78 addons: &gcc45
79 apt:
80 packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"]
81 sources: *apt_sources
82
83 # GCC 4.6
84 - env: COMPILER=g++-4.6
85 compiler: gcc
86 addons: &gcc46
87 apt:
88 packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"]
89 sources: *apt_sources
90
91 # GCC 4.7
92 - env: COMPILER=g++-4.7
93 compiler: gcc
94 addons: &gcc47
95 apt:
96 packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"]
97 sources: *apt_sources
98
99 # GCC 4.8
100 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
101 compiler: gcc
102 addons: &gcc48
103 apt:
104 packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
105 sources: *apt_sources
106
107 # GCC 4.9
108 - 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
109 compiler: gcc
110 addons: &gcc49
111 apt:
112 packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
113 sources: *apt_sources
114
115 # GCC 5
116 - 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"
117 compiler: gcc
118 addons: &gcc5
119 apt:
120 packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
121 sources: *apt_sources
122
123 # GCC 6
124 - 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"
125 compiler: gcc
126 addons: &gcc6
127 apt:
128 packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
129 sources: *apt_sources
130
131 # GCC 7
132 - 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"
133 compiler: gcc
134 addons: &gcc7
135 apt:
136 packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"]
137 sources: *apt_sources
138
onqtamaec53d22017-05-03 06:29:47 +0300139 # Clang 3.5
140 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
141 addons: &clang35
142 apt:
143 packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
144 sources: *apt_sources
145
146 # Clang 3.6
147 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
148 addons: &clang36
149 apt:
150 packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
151 sources: *apt_sources
152
153 # Clang 3.7
154 - env: COMPILER=clang++-3.7
155 addons: &clang37
156 apt:
157 packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
158 sources: *apt_sources
159
160 # Clang 3.8
161 - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true
162 addons: &clang38
163 apt:
164 packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
165 sources: *apt_sources
166
167 # Clang 3.9
168 - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
169 addons: &clang39
170 apt:
171 packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
172 sources: *apt_sources
173
174 # Clang 4.0
175 - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
onqtamaec53d22017-05-03 06:29:47 +0300176 addons: &clang40
177 apt:
178 packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
179 sources: *apt_sources
180
onqtam803bb8f2017-09-05 13:00:24 +0300181 # Clang 5.0
182 - env: COMPILER=clang++-5.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
183 addons: &clang50
184 apt:
185 packages: ["clang-5.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
186 sources: *apt_sources
187
onqtamaec53d22017-05-03 06:29:47 +0300188 # Xcode 6.4 Clang
189 - env: COMPILER=clang++
190 osx_image: xcode6.4
191 os: osx
192
193 # Xcode 7.3 Clang
194 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
195 osx_image: xcode7.3
196 os: osx
197
198 # Xcode 8 Clang
199 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
200 osx_image: xcode8
201 os: osx
202
203 # Xcode 8.1 Clang
204 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
205 osx_image: xcode8.1
206 os: osx
207
208 # Xcode 8.2 Clang
209 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
210 osx_image: xcode8.2
211 os: osx
212
213 # Xcode 8.3 Clang
214 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
215 osx_image: xcode8.3
216 os: osx
217
218 # OSX GCC 4.6
219 - env: COMPILER=g++-4.6
220 compiler: gcc
221 osx_image: xcode6.4
222 os: osx
223
224 # OSX GCC 4.7
225 - env: COMPILER=g++-4.7
226 compiler: gcc
227 osx_image: xcode6.4
228 os: osx
229
230 # OSX GCC 4.8
231 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
232 compiler: gcc
233 osx_image: xcode6.4
234 os: osx
235
236 # OSX GCC 4.9
237 - 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
238 compiler: gcc
239 osx_image: xcode6.4
240 os: osx
241
242 # OSX GCC 5
243 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
244 compiler: gcc
245 osx_image: xcode7.3
246 os: osx
247
248 # OSX GCC 6
249 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
250 compiler: gcc
251 osx_image: xcode7.3
252 os: osx
253
254 # OSX GCC 7
255 - env: COMPILER=g++-7 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 LLVM-GCC
261 - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true
262 compiler: gcc
263 os: osx
264
265 allow_failures:
266
onqtam803bb8f2017-09-05 13:00:24 +0300267 # GCC 4.5
268 - env: COMPILER=g++-4.5
onqtamaec53d22017-05-03 06:29:47 +0300269 compiler: gcc
onqtam803bb8f2017-09-05 13:00:24 +0300270
271 # Clang 3.7
272 - env: COMPILER=clang++-3.7
273
274 # Clang 3.9
275 - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
276
onqtamaec53d22017-05-03 06:29:47 +0300277 # OSX GCC 4.8
278 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
279 compiler: gcc
280 osx_image: xcode6.4
281 os: osx
282
283 # OSX GCC 6
284 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
285 compiler: gcc
286 osx_image: xcode7.3
287 os: osx
288
onqtam803bb8f2017-09-05 13:00:24 +0300289 # OSX GCC 7
onqtamaec53d22017-05-03 06:29:47 +0300290 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
291 compiler: gcc
292 osx_image: xcode7.3
293 os: osx
onqtamb1a3de82016-10-10 22:22:00 +0300294
onqtam2c8036f2016-06-26 17:12:42 +0300295install:
onqtamf6d1a512017-05-01 13:56:12 +0300296 - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
297
onqtam01158572016-06-28 14:29:32 +0300298 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300299 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
300 ############################################################################
301
onqtam5a2b2552017-05-01 14:03:04 +0300302 # Make a dir for all
onqtamc7aaa962016-09-10 02:16:57 +0300303 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
304 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
305
onqtamc7aaa962016-09-10 02:16:57 +0300306 # Install a recent CMake
onqtamc7aaa962016-09-10 02:16:57 +0300307 - |
308 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
onqtam84015352017-03-15 20:11:07 +0200309 CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
onqtamc7aaa962016-09-10 02:16:57 +0300310 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
311 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
312 fi
313
onqtamebc7da32017-05-13 21:33:19 +0300314 # Install OCLint
315 - |
316 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
317 OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz"
318 mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint
319 export PATH=${DEPS_DIR}/oclint/bin:${PATH}
320 fi
321
onqtamc7aaa962016-09-10 02:16:57 +0300322 # Go back to ${TRAVIS_BUILD_DIR}
onqtamc7aaa962016-09-10 02:16:57 +0300323 - cd ${TRAVIS_BUILD_DIR}
324
325 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300326 # Install stuff with homebrew under OSX
327 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300328
onqtam23c6a342016-06-28 14:09:10 +0300329 - |
onqtame4c75fc2016-05-21 01:24:48 +0300330 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
331 brew update
332 # brew install ccache
onqtam27a8c082017-04-04 17:42:41 +0300333 # brew install valgrind
onqtame4c75fc2016-05-21 01:24:48 +0300334 # cmake
335 if brew list -1 | grep -q "^cmake\$"; then
336 brew outdated cmake || brew upgrade cmake
337 else
338 brew install cmake
339 fi
340 # gcc
onqtame4c75fc2016-05-21 01:24:48 +0300341 if [[ "${COMPILER}" = "g++-4.6" ]]; then
342 brew install gcc46
343 fi
344 if [[ "${COMPILER}" = "g++-4.7" ]]; then
345 brew install gcc47
346 fi
347 if [[ "${COMPILER}" = "g++-4.8" ]]; then
onqtamb1a3de82016-10-10 22:22:00 +0300348 brew install gcc48
onqtame4c75fc2016-05-21 01:24:48 +0300349 fi
350 if [[ "${COMPILER}" = "g++-4.9" ]]; then
351 brew install gcc49
352 fi
353 if [[ "${COMPILER}" = "g++-5" ]]; then
354 brew install gcc5
355 fi
356 if [[ "${COMPILER}" = "g++-6" ]]; then
357 brew install gcc6
358 fi
onqtamaab98c52017-05-02 19:48:42 +0300359 if [[ "${COMPILER}" = "g++-7" ]]; then
360 brew install gcc7
361 fi
onqtame4c75fc2016-05-21 01:24:48 +0300362 fi
onqtamf6d1a512017-05-01 13:56:12 +0300363
onqtame4c75fc2016-05-21 01:24:48 +0300364 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300365# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300366# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300367
368before_script:
369 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300370
371script:
onqtam81eab5e2017-05-08 11:51:20 +0300372 # coverage
onqtame4c75fc2016-05-21 01:24:48 +0300373 - |
onqtamf6d1a512017-05-01 13:56:12 +0300374 if [[ "${CODE_COVERAGE}" = "true" ]]; then
onqtam81eab5e2017-05-08 11:51:20 +0300375 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
376 make -k -j2 || exit 1
377 ctest --output-on-failure || exit 1
378
onqtamf6d1a512017-05-01 13:56:12 +0300379 lcov -d . -c -o coverage.info # parse coverage data
380 lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files
381 lcov -l coverage.info # just list a short summary of the results
onqtama6a866f2017-08-28 12:31:43 +0300382 coveralls-lcov --repo-token=${COVERALLS_REPO_TOKEN} coverage.info # upload results
onqtam5a2b2552017-05-01 14:03:04 +0300383
onqtam81eab5e2017-05-08 11:51:20 +0300384 # do not continue with other build configurations after that
onqtame4c75fc2016-05-21 01:24:48 +0300385 exit
386 fi
387
onqtam81eab5e2017-05-08 11:51:20 +0300388 # static code analysis
onqtam21623a62017-04-27 21:47:46 +0300389 - |
onqtam0decb1d2017-04-30 19:37:29 +0300390 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
onqtamebc7da32017-05-13 21:33:19 +0300391 # setup a test file "doctest.cpp" that is the header + a test case at the end
392 echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp
393 cat doctest/doctest.h >> doctest.cpp
onqtamc2b6e132017-05-08 16:37:31 +0300394 echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp
395
onqtamebc7da32017-05-13 21:33:19 +0300396 # cppcheck
397 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}"
398
399 # oclint
400 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 +0300401
402 # clang-tidy
403 cd scripts/playground
onqtamc2b6e132017-05-08 16:37:31 +0300404 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1
onqtamfdd233c2017-05-09 20:24:32 +0300405 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 +0300406
407 # do not continue with other build configurations after that
408 exit
409 fi
onqtam21623a62017-04-27 21:47:46 +0300410
onqtame4c75fc2016-05-21 01:24:48 +0300411 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300412 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300413
onqtam1586ea22016-05-21 18:02:26 +0300414 # debug x64
onqtam56d91702017-04-16 21:03:58 +0300415 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300416 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300417 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
418 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300419 # release x64
onqtam56d91702017-04-16 21:03:58 +0300420 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300421 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300422 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
423 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300424 # debug x86
onqtam56d91702017-04-16 21:03:58 +0300425 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300426 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300427 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
428 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300429 # release x86
onqtam56d91702017-04-16 21:03:58 +0300430 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300431 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300432 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
433 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300434
435 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam56d91702017-04-16 21:03:58 +0300436 - cmake -DDOCTEST_TEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300437 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300438 # 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 +0300439 - 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
440 - 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
441 - 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
442 - 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
443 - 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
444 - 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
445 - 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
446 - 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 +0300447
onqtam7a3ad262017-03-18 18:05:10 +0200448 # test in c++0x mode - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300449 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" .
onqtam5cab8e92016-10-10 17:58:38 +0300450 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300451 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam5cab8e92016-10-10 17:58:38 +0300452
onqtam7a3ad262017-03-18 18:05:10 +0200453 # test without rtti - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300454 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" .
onqtamf63c5102017-02-25 20:00:52 +0200455 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300456 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtamf63c5102017-02-25 20:00:52 +0200457
onqtam7a3ad262017-03-18 18:05:10 +0200458 # test only compilation without exceptions - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300459 - 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 +0200460 - make clean && make -k -j2
461
onqtame4c75fc2016-05-21 01:24:48 +0300462# - ccache -s
463
onqtam2dd55282016-06-13 18:05:38 +0300464#after_script:
465# - cat compile_commands.json