blob: d92ec384c72e9b1f6f592a314058e253849a892d [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
123# # 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
onqtam5ddd43a2016-05-21 20:10:08 +0300128# compiler: gcc
onqtam90d95de2016-05-22 04:17:34 +0300129# addons: &gcc6
onqtam5ddd43a2016-05-21 20:10:08 +0300130# apt:
onqtam90d95de2016-05-22 04:17:34 +0300131# packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300132# 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
207 # OSX GCC 4.4
208 - env: COMPILER=g++-4.4
209 compiler: gcc
210 os: osx
211
212 # OSX GCC 4.5
213 - env: COMPILER=g++-4.5
214 compiler: gcc
215 os: osx
216
217 # OSX GCC 4.6
218 - env: COMPILER=g++-4.6
219 compiler: gcc
220 os: osx
221
222 # OSX GCC 4.7
223 - env: COMPILER=g++-4.7
224 compiler: gcc
225 os: osx
226
227 # OSX GCC 4.8
228 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
229 compiler: gcc
230 os: osx
231
232 # OSX GCC 4.9
233 - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
234 compiler: gcc
235 os: osx
236
237 # OSX GCC 5
238 - env: COMPILER=g++-5 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 6
243# - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam695fded2016-04-30 15:14:08 +0300244# compiler: gcc
245# os: osx
onqtam90d95de2016-05-22 04:17:34 +0300246
247 # OSX LLVM-GCC
248 - env: COMPILER=g++
249 compiler: gcc
250 os: osx
onqtame4c75fc2016-05-21 01:24:48 +0300251
onqtam3ffb8872016-06-07 23:46:09 +0300252 allow_failures:
253 # because in the period of the past week (01.06 to 06.06) all ASAN builds started failing with this error:
254 # /usr/bin/ld: unrecognized option '--push-state'
255 # see this question for details - http://stackoverflow.com/questions/37688926/asan-with-g-5-4-0-not-working-on-travis-ci
256 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
257 os: linux
onqtam5bb6fcc2016-06-10 21:35:44 +0300258 # the clang builds for linux fail because the llvm apt is down
onqtam89e3fe62016-06-10 21:37:48 +0300259 - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam5bb6fcc2016-06-10 21:35:44 +0300260 os: linux
onqtam89e3fe62016-06-10 21:37:48 +0300261 - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam5bb6fcc2016-06-10 21:35:44 +0300262 os: linux
263 - env: COMPILER=clang++-3.7
264 os: linux
265 - env: COMPILER=clang++-3.8
266 os: linux
onqtam3ffb8872016-06-07 23:46:09 +0300267
onqtame4c75fc2016-05-21 01:24:48 +0300268before_install:
269 - |
270 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
271 brew update
272 # brew install ccache
273 brew install valgrind
274 # cmake
275 if brew list -1 | grep -q "^cmake\$"; then
276 brew outdated cmake || brew upgrade cmake
277 else
278 brew install cmake
279 fi
280 # gcc
281 if [[ "${COMPILER}" = "g++-4.4" ]]; then
282 brew install gcc44
283 fi
284 if [[ "${COMPILER}" = "g++-4.5" ]]; then
285 brew install gcc45
286 fi
287 if [[ "${COMPILER}" = "g++-4.6" ]]; then
288 brew install gcc46
289 fi
290 if [[ "${COMPILER}" = "g++-4.7" ]]; then
291 brew install gcc47
292 fi
293 if [[ "${COMPILER}" = "g++-4.8" ]]; then
294 brew outdated gcc48 || brew upgrade gcc48
295 fi
296 if [[ "${COMPILER}" = "g++-4.9" ]]; then
297 brew install gcc49
298 fi
299 if [[ "${COMPILER}" = "g++-5" ]]; then
300 brew install gcc5
301 fi
302 if [[ "${COMPILER}" = "g++-6" ]]; then
303 brew install gcc6
304 fi
305 fi
306 - git submodule update --init --recursive
307
308install:
309 - ${CXX} --version
310# - export CXX="ccache ${COMPILER}"
311 - export CXX="${COMPILER}"
312 - ${CXX} --version
313# - ccache -s
314
315script:
316 # coverage - do not continue with other build configurations after that
317 - |
318 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
319 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300320 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300321 exit
322 fi
323
324 # initial run with options
325 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} .
326
onqtam1586ea22016-05-21 18:02:26 +0300327 # debug x64
328 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" .
329 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300330 # valgrind for 64bit under osx fails TOO
331 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
332 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300333 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
334 # release x64
335 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" .
336 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300337 # valgrind for 64bit under osx fails TOO
338 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
339 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300340 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300341 # debug x86
342 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300343 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300344 # valgrind for 32bit under osx fails
345 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300346 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300347 # release x86
348 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300349 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300350 # valgrind for 32bit under osx fails
351 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300352 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300353
354 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam1586ea22016-05-21 18:02:26 +0300355 - cmake -DTEST_MODE=COMPARE .
onqtame4c75fc2016-05-21 01:24:48 +0300356 # on separate commands because when something fails I want to see which one exactly
onqtam316fce22016-05-21 16:57:13 +0300357 - 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
358 - 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
359 - 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
360 - 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
361 - 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
362 - 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
363 - 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
364 - 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 +0300365
366# - ccache -s
367
onqtam2dd55282016-06-13 18:05:38 +0300368#after_script:
369# - cat compile_commands.json