blob: cafdabdd1a99b1c229ee330ff2c770935daa466a [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
onqtam8603d872017-10-06 10:53:25 +0300218 # Xcode 9 Clang
219 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
220 osx_image: xcode9
221 os: osx
222
223 # Xcode 9.1 Clang
224 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
225 osx_image: xcode9.1
226 os: osx
227
onqtamaec53d22017-05-03 06:29:47 +0300228 # OSX GCC 4.6
229 - env: COMPILER=g++-4.6
230 compiler: gcc
231 osx_image: xcode6.4
232 os: osx
233
234 # OSX GCC 4.7
235 - env: COMPILER=g++-4.7
236 compiler: gcc
237 osx_image: xcode6.4
238 os: osx
239
240 # OSX GCC 4.8
241 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
242 compiler: gcc
243 osx_image: xcode6.4
244 os: osx
245
246 # OSX GCC 4.9
247 - 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
248 compiler: gcc
249 osx_image: xcode6.4
250 os: osx
251
252 # OSX GCC 5
253 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
254 compiler: gcc
255 osx_image: xcode7.3
256 os: osx
257
258 # OSX GCC 6
259 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
260 compiler: gcc
261 osx_image: xcode7.3
262 os: osx
263
264 # OSX GCC 7
265 - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
266 compiler: gcc
267 osx_image: xcode7.3
268 os: osx
269
270 # OSX LLVM-GCC
271 - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true
272 compiler: gcc
273 os: osx
274
275 allow_failures:
276
onqtam803bb8f2017-09-05 13:00:24 +0300277 # GCC 4.5
278 - env: COMPILER=g++-4.5
onqtamaec53d22017-05-03 06:29:47 +0300279 compiler: gcc
onqtam803bb8f2017-09-05 13:00:24 +0300280
281 # Clang 3.7
282 - env: COMPILER=clang++-3.7
283
284 # Clang 3.9
285 - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true
286
onqtamaec53d22017-05-03 06:29:47 +0300287 # 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
onqtam803bb8f2017-09-05 13:00:24 +0300299 # OSX GCC 7
onqtamaec53d22017-05-03 06:29:47 +0300300 - 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
onqtam2c8036f2016-06-26 17:12:42 +0300305install:
onqtamf6d1a512017-05-01 13:56:12 +0300306 - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
307
onqtam01158572016-06-28 14:29:32 +0300308 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300309 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
310 ############################################################################
311
onqtam5a2b2552017-05-01 14:03:04 +0300312 # Make a dir for all
onqtamc7aaa962016-09-10 02:16:57 +0300313 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
314 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
315
onqtamc7aaa962016-09-10 02:16:57 +0300316 # Install a recent CMake
onqtamc7aaa962016-09-10 02:16:57 +0300317 - |
318 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
onqtam84015352017-03-15 20:11:07 +0200319 CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
onqtamc7aaa962016-09-10 02:16:57 +0300320 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
321 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
322 fi
323
onqtamebc7da32017-05-13 21:33:19 +0300324 # Install OCLint
325 - |
326 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
327 OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz"
328 mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint
329 export PATH=${DEPS_DIR}/oclint/bin:${PATH}
330 fi
331
onqtamc7aaa962016-09-10 02:16:57 +0300332 # Go back to ${TRAVIS_BUILD_DIR}
onqtamc7aaa962016-09-10 02:16:57 +0300333 - cd ${TRAVIS_BUILD_DIR}
334
335 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300336 # Install stuff with homebrew under OSX
337 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300338
onqtam23c6a342016-06-28 14:09:10 +0300339 - |
onqtame4c75fc2016-05-21 01:24:48 +0300340 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
341 brew update
342 # brew install ccache
onqtam27a8c082017-04-04 17:42:41 +0300343 # brew install valgrind
onqtame4c75fc2016-05-21 01:24:48 +0300344 # cmake
345 if brew list -1 | grep -q "^cmake\$"; then
346 brew outdated cmake || brew upgrade cmake
347 else
348 brew install cmake
349 fi
350 # gcc
onqtame4c75fc2016-05-21 01:24:48 +0300351 if [[ "${COMPILER}" = "g++-4.6" ]]; then
352 brew install gcc46
353 fi
354 if [[ "${COMPILER}" = "g++-4.7" ]]; then
355 brew install gcc47
356 fi
357 if [[ "${COMPILER}" = "g++-4.8" ]]; then
onqtamb1a3de82016-10-10 22:22:00 +0300358 brew install gcc48
onqtame4c75fc2016-05-21 01:24:48 +0300359 fi
360 if [[ "${COMPILER}" = "g++-4.9" ]]; then
361 brew install gcc49
362 fi
363 if [[ "${COMPILER}" = "g++-5" ]]; then
364 brew install gcc5
365 fi
366 if [[ "${COMPILER}" = "g++-6" ]]; then
367 brew install gcc6
368 fi
onqtamaab98c52017-05-02 19:48:42 +0300369 if [[ "${COMPILER}" = "g++-7" ]]; then
370 brew install gcc7
371 fi
onqtame4c75fc2016-05-21 01:24:48 +0300372 fi
onqtamf6d1a512017-05-01 13:56:12 +0300373
onqtame4c75fc2016-05-21 01:24:48 +0300374 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300375# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300376# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300377
378before_script:
379 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300380
381script:
onqtam81eab5e2017-05-08 11:51:20 +0300382 # coverage
onqtame4c75fc2016-05-21 01:24:48 +0300383 - |
onqtamf6d1a512017-05-01 13:56:12 +0300384 if [[ "${CODE_COVERAGE}" = "true" ]]; then
onqtam81eab5e2017-05-08 11:51:20 +0300385 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
386 make -k -j2 || exit 1
387 ctest --output-on-failure || exit 1
388
onqtamf6d1a512017-05-01 13:56:12 +0300389 lcov -d . -c -o coverage.info # parse coverage data
390 lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files
391 lcov -l coverage.info # just list a short summary of the results
onqtama6a866f2017-08-28 12:31:43 +0300392 coveralls-lcov --repo-token=${COVERALLS_REPO_TOKEN} coverage.info # upload results
onqtam5a2b2552017-05-01 14:03:04 +0300393
onqtam81eab5e2017-05-08 11:51:20 +0300394 # do not continue with other build configurations after that
onqtame4c75fc2016-05-21 01:24:48 +0300395 exit
396 fi
397
onqtam81eab5e2017-05-08 11:51:20 +0300398 # static code analysis
onqtam21623a62017-04-27 21:47:46 +0300399 - |
onqtam0decb1d2017-04-30 19:37:29 +0300400 if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then
onqtamebc7da32017-05-13 21:33:19 +0300401 # setup a test file "doctest.cpp" that is the header + a test case at the end
402 echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp
403 cat doctest/doctest.h >> doctest.cpp
onqtamc2b6e132017-05-08 16:37:31 +0300404 echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp
405
onqtamebc7da32017-05-13 21:33:19 +0300406 # cppcheck
407 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}"
408
409 # oclint
410 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 +0300411
412 # clang-tidy
413 cd scripts/playground
onqtamc2b6e132017-05-08 16:37:31 +0300414 cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1
onqtamfdd233c2017-05-09 20:24:32 +0300415 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 +0300416
417 # do not continue with other build configurations after that
418 exit
419 fi
onqtam21623a62017-04-27 21:47:46 +0300420
onqtame4c75fc2016-05-21 01:24:48 +0300421 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300422 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300423
onqtam1586ea22016-05-21 18:02:26 +0300424 # debug x64
onqtam56d91702017-04-16 21:03:58 +0300425 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +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
onqtam1586ea22016-05-21 18:02:26 +0300429 # release x64
onqtam56d91702017-04-16 21:03:58 +0300430 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" .
onqtam1586ea22016-05-21 18:02:26 +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 # debug x86
onqtam56d91702017-04-16 21:03:58 +0300435 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300436 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300437 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
438 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300439 # release x86
onqtam56d91702017-04-16 21:03:58 +0300440 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" .
onqtam316fce22016-05-21 16:57:13 +0300441 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300442 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
443 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300444
445 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam56d91702017-04-16 21:03:58 +0300446 - cmake -DDOCTEST_TEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300447 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300448 # 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 +0300449 - 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
450 - 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
451 - 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
452 - 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
453 - 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
454 - 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
455 - 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
456 - 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 +0300457
onqtam7a3ad262017-03-18 18:05:10 +0200458 # test in c++0x mode - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300459 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" .
onqtam5cab8e92016-10-10 17:58:38 +0300460 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300461 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtam5cab8e92016-10-10 17:58:38 +0300462
onqtam7a3ad262017-03-18 18:05:10 +0200463 # test without rtti - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300464 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" .
onqtamf63c5102017-02-25 20:00:52 +0200465 - make clean && make -k -j2
onqtam56d91702017-04-16 21:03:58 +0300466 - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure
onqtamf63c5102017-02-25 20:00:52 +0200467
onqtam7a3ad262017-03-18 18:05:10 +0200468 # test only compilation without exceptions - just Debug/x64
onqtam56d91702017-04-16 21:03:58 +0300469 - 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 +0200470 - make clean && make -k -j2
471
onqtame4c75fc2016-05-21 01:24:48 +0300472# - ccache -s
473
onqtam2dd55282016-06-13 18:05:38 +0300474#after_script:
475# - cat compile_commands.json