blob: 5669aa447ba7b171d8790fc04c3c5eeabb48ad2e [file] [log] [blame]
onqtame4c75fc2016-05-21 01:24:48 +03001sudo: false
2language: c++
3
4notifications:
5 email:
6 on_success: change
7 on_failure: always
8 # gitter
9 webhooks:
10 urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706
11 on_success: change
12 on_failure: always
13git:
onqtam5bb6fcc2016-06-10 21:35:44 +030014 depth: 100
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:
onqtam5bb6fcc2016-06-10 21:35:44 +030045 sources: &llvm_apt_sources
46 - llvm-toolchain-precise-3.5
47 - llvm-toolchain-precise-3.6
48 - llvm-toolchain-precise-3.7
49 - llvm-toolchain-precise-3.8
50 - llvm-toolchain-precise
onqtame4c75fc2016-05-21 01:24:48 +030051
52compiler: clang
53os: linux
54
55matrix:
56 exclude:
57 - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
58
59 include:
onqtam90d95de2016-05-22 04:17:34 +030060 # coverage
61 - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci
62 compiler: gcc
63 addons:
64 apt:
65 packages: ["lcov", "curl"]
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"]
onqtam5bb6fcc2016-06-10 21:35:44 +030073 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +030074
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"]
onqtam5bb6fcc2016-06-10 21:35:44 +030081 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +030082
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"]
onqtam5bb6fcc2016-06-10 21:35:44 +030089 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +030090
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"]
onqtam5bb6fcc2016-06-10 21:35:44 +030097 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +030098
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"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300105 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +0300106
107 # GCC 4.9
108 - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
109 compiler: gcc
110 addons: &gcc49
111 apt:
112 packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300113 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +0300114
115 # GCC 5
116 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
117 compiler: gcc
118 addons: &gcc5
119 apt:
120 packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300121 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +0300122
onqtam3b2f7982016-06-15 20:07:50 +0300123 # GCC 6
124 # released on 2016.04.27
125 # wait for it to enter the whitelist - https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
126 # also with homebrew under OSX!!!
127 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
128 compiler: gcc
129 addons: &gcc6
130 apt:
131 packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
132 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +0300133
onqtam5bb6fcc2016-06-10 21:35:44 +0300134 # Clang 3.4
135 - env: COMPILER=clang++ HAS_ASAN_64=true HAS_UBSAN_64=true
136 addons: &clang
137 apt:
138 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
139
140 # Clang 3.5
141 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
142 addons: &clang35
143 apt:
144 packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
145 sources: *llvm_apt_sources
146
147 # Clang 3.6
148 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
149 addons: &clang36
150 apt:
151 packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
152 sources: *llvm_apt_sources
153
154 # Clang 3.7
155 - env: COMPILER=clang++-3.7 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
156 addons: &clang37
157 apt:
158 packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
159 sources: *llvm_apt_sources
160
161 # Clang 3.8
162 - env: COMPILER=clang++-3.8 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
163 addons: &clang38
164 apt:
165 packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
166 sources: *llvm_apt_sources
onqtam90d95de2016-05-22 04:17:34 +0300167
168 # Xcode 6.1 Clang
169 - env: COMPILER=clang++
170 os: osx
171
172 # Xcode 6.2 Clang
173 - env: COMPILER=clang++
174 osx_image: beta-xcode6.2
175 os: osx
176
177 # Xcode 6.3 Clang
178 - env: COMPILER=clang++
179 osx_image: beta-xcode6.3
180 os: osx
181
182 # Xcode 6.4 Clang
183 - env: COMPILER=clang++
184 osx_image: xcode6.4
185 os: osx
186
187 # Xcode 7 Clang
188 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
189 osx_image: xcode7
190 os: osx
191
192 # Xcode 7.1 Clang
193 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
194 osx_image: xcode7.1
195 os: osx
196
197 # Xcode 7.2 Clang
198 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
199 osx_image: xcode7.2
200 os: osx
201
202 # Xcode 7.3 Clang
203 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
204 osx_image: xcode7.3
205 os: osx
206
onqtam692541c2016-06-14 09:58:04 +0300207 # Xcode 8 Clang
208 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
209 osx_image: xcode8
210 os: osx
211
onqtam90d95de2016-05-22 04:17:34 +0300212 # OSX GCC 4.4
213 - env: COMPILER=g++-4.4
214 compiler: gcc
215 os: osx
216
217 # OSX GCC 4.5
218 - env: COMPILER=g++-4.5
219 compiler: gcc
220 os: osx
221
222 # OSX GCC 4.6
223 - env: COMPILER=g++-4.6
224 compiler: gcc
225 os: osx
226
227 # OSX GCC 4.7
228 - env: COMPILER=g++-4.7
229 compiler: gcc
230 os: osx
231
232 # OSX GCC 4.8
233 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
234 compiler: gcc
235 os: osx
236
237 # OSX GCC 4.9
238 - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
239 compiler: gcc
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 os: osx
246
onqtam3b2f7982016-06-15 20:07:50 +0300247 # OSX GCC 6
248 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
249 compiler: gcc
250 os: osx
onqtam90d95de2016-05-22 04:17:34 +0300251
252 # OSX LLVM-GCC
253 - env: COMPILER=g++
254 compiler: gcc
255 os: osx
onqtame4c75fc2016-05-21 01:24:48 +0300256
onqtam3ffb8872016-06-07 23:46:09 +0300257 allow_failures:
258 # because in the period of the past week (01.06 to 06.06) all ASAN builds started failing with this error:
259 # /usr/bin/ld: unrecognized option '--push-state'
260 # see this question for details - http://stackoverflow.com/questions/37688926/asan-with-g-5-4-0-not-working-on-travis-ci
261 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
262 os: linux
onqtam5bb6fcc2016-06-10 21:35:44 +0300263 # the clang builds for linux fail because the llvm apt is down
onqtam89e3fe62016-06-10 21:37:48 +0300264 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam5bb6fcc2016-06-10 21:35:44 +0300265 os: linux
onqtam89e3fe62016-06-10 21:37:48 +0300266 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam5bb6fcc2016-06-10 21:35:44 +0300267 os: linux
268 - env: COMPILER=clang++-3.7
269 os: linux
270 - env: COMPILER=clang++-3.8
271 os: linux
onqtam3ffb8872016-06-07 23:46:09 +0300272
onqtame4c75fc2016-05-21 01:24:48 +0300273before_install:
274 - |
275 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
276 brew update
277 # brew install ccache
278 brew install valgrind
279 # cmake
280 if brew list -1 | grep -q "^cmake\$"; then
281 brew outdated cmake || brew upgrade cmake
282 else
283 brew install cmake
284 fi
285 # gcc
286 if [[ "${COMPILER}" = "g++-4.4" ]]; then
287 brew install gcc44
288 fi
289 if [[ "${COMPILER}" = "g++-4.5" ]]; then
290 brew install gcc45
291 fi
292 if [[ "${COMPILER}" = "g++-4.6" ]]; then
293 brew install gcc46
294 fi
295 if [[ "${COMPILER}" = "g++-4.7" ]]; then
296 brew install gcc47
297 fi
298 if [[ "${COMPILER}" = "g++-4.8" ]]; then
299 brew outdated gcc48 || brew upgrade gcc48
300 fi
301 if [[ "${COMPILER}" = "g++-4.9" ]]; then
302 brew install gcc49
303 fi
304 if [[ "${COMPILER}" = "g++-5" ]]; then
305 brew install gcc5
306 fi
307 if [[ "${COMPILER}" = "g++-6" ]]; then
308 brew install gcc6
309 fi
310 fi
311 - git submodule update --init --recursive
312
313install:
314 - ${CXX} --version
315# - export CXX="ccache ${COMPILER}"
316 - export CXX="${COMPILER}"
317 - ${CXX} --version
318# - ccache -s
319
320script:
321 # coverage - do not continue with other build configurations after that
322 - |
323 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
324 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300325 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300326 exit
327 fi
328
329 # initial run with options
330 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} .
331
onqtam1586ea22016-05-21 18:02:26 +0300332 # debug x64
333 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" .
334 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300335 # valgrind for 64bit under osx fails TOO
336 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
337 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300338 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
339 # release x64
340 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" .
341 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300342 # valgrind for 64bit under osx fails TOO
343 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
344 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300345 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300346 # debug x86
347 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300348 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300349 # valgrind for 32bit under osx fails
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
onqtame4c75fc2016-05-21 01:24:48 +0300352 # release x86
353 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300354 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300355 # valgrind for 32bit under osx fails
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
359 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam1586ea22016-05-21 18:02:26 +0300360 - cmake -DTEST_MODE=COMPARE .
onqtame4c75fc2016-05-21 01:24:48 +0300361 # on separate commands because when something fails I want to see which one exactly
onqtam316fce22016-05-21 16:57:13 +0300362 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
363 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
364 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
365 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
366 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
367 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
368 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
369 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
onqtame4c75fc2016-05-21 01:24:48 +0300370
371# - ccache -s
372
onqtam2dd55282016-06-13 18:05:38 +0300373#after_script:
374# - cat compile_commands.json