blob: ba954b1de60c8141ab1fd4a5d6eb49341c2cdef2 [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
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
51 - llvm-toolchain-precise
onqtame4c75fc2016-05-21 01:24:48 +030052
53compiler: clang
54os: linux
55
56matrix:
57 exclude:
58 - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
59
60 include:
onqtamd1737e42016-08-01 19:05:07 +030061 # coverage
62 - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci
63 compiler: gcc
64 addons:
65 apt:
66 packages: ["lcov", "curl"]
67
onqtam529c92c2016-08-02 17:51:59 +030068 # GCC 4.4
69 - env: COMPILER=g++-4.4
70 compiler: gcc
71 addons: &gcc44
72 apt:
73 packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"]
74 sources: *apt_sources
75
76 # GCC 4.5
77 - env: COMPILER=g++-4.5
78 compiler: gcc
79 addons: &gcc45
80 apt:
81 packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"]
82 sources: *apt_sources
83
84 # GCC 4.6
85 - env: COMPILER=g++-4.6
86 compiler: gcc
87 addons: &gcc46
88 apt:
89 packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"]
90 sources: *apt_sources
91
92 # GCC 4.7
93 - env: COMPILER=g++-4.7
94 compiler: gcc
95 addons: &gcc47
96 apt:
97 packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"]
98 sources: *apt_sources
99
100 # GCC 4.8
101 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
102 compiler: gcc
103 addons: &gcc48
104 apt:
105 packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
106 sources: *apt_sources
107
108 # GCC 4.9
onqtamf5169772016-09-09 18:33:13 +0300109 - env: COMPILER=g++-4.9 HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true # ASAN_32 dropped weird errors when using ASAN_OPTIONS - most probably g++ 4.9 bug
onqtam529c92c2016-08-02 17:51:59 +0300110 compiler: gcc
111 addons: &gcc49
112 apt:
113 packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
114 sources: *apt_sources
115
116 # GCC 5
117 - 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"
118 compiler: gcc
119 addons: &gcc5
120 apt:
121 packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
122 sources: *apt_sources
123
124 # GCC 6
125 - 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"
126 compiler: gcc
127 addons: &gcc6
128 apt:
129 packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
130 sources: *apt_sources
131
132 # Clang 3.4
onqtamc30ab662016-08-05 01:13:08 +0300133 - env: COMPILER=clang++ HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam529c92c2016-08-02 17:51:59 +0300134 addons: &clang
135 apt:
136 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"]
137 sources: *apt_sources
138
139 # Clang 3.5
onqtamc30ab662016-08-05 01:13:08 +0300140 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam529c92c2016-08-02 17:51:59 +0300141 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
onqtamc30ab662016-08-05 01:13:08 +0300147 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam529c92c2016-08-02 17:51:59 +0300148 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
onqtamc30ab662016-08-05 01:13:08 +0300154 - env: COMPILER=clang++-3.7
onqtam529c92c2016-08-02 17:51:59 +0300155 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
onqtamc30ab662016-08-05 01:13:08 +0300161 - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam529c92c2016-08-02 17:51:59 +0300162 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 # Xcode 6.1 Clang
168 - env: COMPILER=clang++
169 os: osx
170
171 # Xcode 6.2 Clang
172 - env: COMPILER=clang++
173 osx_image: beta-xcode6.2
174 os: osx
175
176 # Xcode 6.3 Clang
177 - env: COMPILER=clang++
178 osx_image: beta-xcode6.3
179 os: osx
180
181 # Xcode 6.4 Clang
182 - env: COMPILER=clang++
183 osx_image: xcode6.4
184 os: osx
185
186 # Xcode 7 Clang
187 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
188 osx_image: xcode7
189 os: osx
190
191 # Xcode 7.1 Clang
192 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
193 osx_image: xcode7.1
194 os: osx
195
196 # Xcode 7.2 Clang
197 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
198 osx_image: xcode7.2
199 os: osx
200
201 # Xcode 7.3 Clang
202 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
203 osx_image: xcode7.3
204 os: osx
205
206 # Xcode 8 Clang
207 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
208 osx_image: xcode8
209 os: osx
210
211 # OSX GCC 4.4
212 - env: COMPILER=g++-4.4
213 compiler: gcc
214 os: osx
215
216 # OSX GCC 4.5
217 - env: COMPILER=g++-4.5
218 compiler: gcc
219 os: osx
220
221 # OSX GCC 4.6
222 - env: COMPILER=g++-4.6
223 compiler: gcc
224 os: osx
225
226 # OSX GCC 4.7
227 - env: COMPILER=g++-4.7
228 compiler: gcc
229 os: osx
230
231 # OSX GCC 4.8
232 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
233 compiler: gcc
234 os: osx
235
236 # OSX GCC 4.9
onqtamf5169772016-09-09 18:33:13 +0300237 - env: COMPILER=g++-4.9 HAS_UBSAN_32=true HAS_UBSAN_64=true # ASAN_32/ASAN_64 dropped weird errors when using ASAN_OPTIONS - most probably g++ 4.9 bug
onqtam529c92c2016-08-02 17:51:59 +0300238 compiler: gcc
239 os: osx
240
241 # OSX GCC 5
242 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
243 compiler: gcc
244 os: osx
245
246 # OSX GCC 6
247 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
248 compiler: gcc
249 os: osx
250
251 # OSX LLVM-GCC
252 - env: COMPILER=g++
253 compiler: gcc
254 os: osx
onqtame4c75fc2016-05-21 01:24:48 +0300255
onqtam3ffb8872016-06-07 23:46:09 +0300256 allow_failures:
onqtam3ffb8872016-06-07 23:46:09 +0300257
onqtame4c75fc2016-05-21 01:24:48 +0300258before_install:
onqtam2c8036f2016-06-26 17:12:42 +0300259 - git submodule update --init --recursive
260
261install:
onqtam01158572016-06-28 14:29:32 +0300262 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300263 # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
264 ############################################################################
265
266 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
267 - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
268
269 ############################################################################
270 # Install a recent CMake
271 ############################################################################
272
273 - |
274 if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
275 CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz"
276 mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
277 export PATH=${DEPS_DIR}/cmake/bin:${PATH}
278 fi
279
280 ############################################################################
281 # Go back to ${TRAVIS_BUILD_DIR}
282 ############################################################################
283
284 - cd ${TRAVIS_BUILD_DIR}
285
286 ############################################################################
onqtam01158572016-06-28 14:29:32 +0300287 # Install stuff with homebrew under OSX
288 ############################################################################
onqtamc7aaa962016-09-10 02:16:57 +0300289
onqtam23c6a342016-06-28 14:09:10 +0300290 - |
onqtame4c75fc2016-05-21 01:24:48 +0300291 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
292 brew update
293 # brew install ccache
294 brew install valgrind
295 # cmake
296 if brew list -1 | grep -q "^cmake\$"; then
297 brew outdated cmake || brew upgrade cmake
298 else
299 brew install cmake
300 fi
301 # gcc
302 if [[ "${COMPILER}" = "g++-4.4" ]]; then
303 brew install gcc44
304 fi
305 if [[ "${COMPILER}" = "g++-4.5" ]]; then
306 brew install gcc45
307 fi
308 if [[ "${COMPILER}" = "g++-4.6" ]]; then
309 brew install gcc46
310 fi
311 if [[ "${COMPILER}" = "g++-4.7" ]]; then
312 brew install gcc47
313 fi
314 if [[ "${COMPILER}" = "g++-4.8" ]]; then
315 brew outdated gcc48 || brew upgrade gcc48
316 fi
317 if [[ "${COMPILER}" = "g++-4.9" ]]; then
318 brew install gcc49
319 fi
320 if [[ "${COMPILER}" = "g++-5" ]]; then
321 brew install gcc5
322 fi
323 if [[ "${COMPILER}" = "g++-6" ]]; then
324 brew install gcc6
325 fi
326 fi
onqtame4c75fc2016-05-21 01:24:48 +0300327 - export CXX="${COMPILER}"
onqtam9f934f82016-08-02 12:42:19 +0300328# - export CXX="ccache ${COMPILER}"
onqtame4c75fc2016-05-21 01:24:48 +0300329# - ccache -s
onqtam7dec6aa2016-06-26 16:01:15 +0300330
331before_script:
332 - ${CXX} --version
onqtame4c75fc2016-05-21 01:24:48 +0300333
334script:
335 # coverage - do not continue with other build configurations after that
336 - |
337 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
338 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300339 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300340 exit
341 fi
342
343 # initial run with options
onqtamcc350302016-06-28 14:36:28 +0300344 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} .
onqtame4c75fc2016-05-21 01:24:48 +0300345
onqtam1586ea22016-05-21 18:02:26 +0300346 # debug x64
onqtamfa5a8522016-06-26 20:15:56 +0300347 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300348 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300349 # valgrind for 64bit under osx fails TOO
350 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300351 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
352 # release x64
onqtamfa5a8522016-06-26 20:15:56 +0300353 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m64" .
onqtam1586ea22016-05-21 18:02:26 +0300354 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300355 # valgrind for 64bit under osx fails TOO
356 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300357 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300358 # debug x86
onqtamfa5a8522016-06-26 20:15:56 +0300359 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32" .
onqtam316fce22016-05-21 16:57:13 +0300360 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300361 # valgrind for 32bit under osx fails
362 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300363 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300364 # release x86
onqtamfa5a8522016-06-26 20:15:56 +0300365 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -m32" .
onqtam316fce22016-05-21 16:57:13 +0300366 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300367 # valgrind for 32bit under osx fails
368 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300369 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300370
371 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtamfba7fb72016-08-22 14:18:24 +0300372 - cmake -DTEST_MODE=NORMAL .
onqtame4c75fc2016-05-21 01:24:48 +0300373 # on separate commands because when something fails I want to see which one exactly
onqtam84b19bc2016-08-26 12:40:31 +0300374 # TODO: when this http://stackoverflow.com/questions/39081183 gets resolved - add these to ASAN as well: check_initialization_order=true:strict_init_order=true
375 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -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
376 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -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
377 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -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
378 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -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
379 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -g -fno-omit-frame-pointer -m64 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
380 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -g -fno-omit-frame-pointer -m32 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
381 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -g -fno-omit-frame-pointer -m64 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi
382 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -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 +0300383
384# - ccache -s
385
onqtam2dd55282016-06-13 18:05:38 +0300386#after_script:
387# - cat compile_commands.json