blob: 17c25f017057a04673cf689585e497be0881cb49 [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:
14 depth: 5
15
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:
45 sources: &apt_sources
46 - ubuntu-toolchain-r-test
onqtam2704f922016-06-07 12:15:06 +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:
onqtam90d95de2016-05-22 04:17:34 +030061 # coverage
62 - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci
63 compiler: gcc
64 addons:
65 apt:
66 packages: ["lcov", "curl"]
67
68 # 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
109 - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
110 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
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# # released on 2016.04.27
126# # wait for it to enter the whitelist - https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
127# # also with homebrew under OSX!!!
128# - 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 +0300129# compiler: gcc
onqtam90d95de2016-05-22 04:17:34 +0300130# addons: &gcc6
onqtam5ddd43a2016-05-21 20:10:08 +0300131# apt:
onqtam90d95de2016-05-22 04:17:34 +0300132# packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam695fded2016-04-30 15:14:08 +0300133# sources: *apt_sources
onqtam90d95de2016-05-22 04:17:34 +0300134
onqtam2704f922016-06-07 12:15:06 +0300135# # Clang 3.4
136# - env: COMPILER=clang++ HAS_ASAN_64=true HAS_UBSAN_64=true
137# addons: &clang
138# apt:
139# packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
140# sources: *apt_sources
141#
142# # Clang 3.5
143# - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true
144# addons: &clang35
145# apt:
146# packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
147# sources: *apt_sources
148#
149# # Clang 3.6
150# - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true
151# addons: &clang36
152# apt:
153# packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
154# sources: *apt_sources
155#
156# # Clang 3.7
157# - env: COMPILER=clang++-3.7 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
158# addons: &clang37
159# apt:
160# packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
161# sources: *apt_sources
162#
163# # Clang 3.8
164# - env: COMPILER=clang++-3.8 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
165# addons: &clang38
166# apt:
167# packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
168# sources: *apt_sources
onqtam90d95de2016-05-22 04:17:34 +0300169
170 # Xcode 6.1 Clang
171 - env: COMPILER=clang++
172 os: osx
173
174 # Xcode 6.2 Clang
175 - env: COMPILER=clang++
176 osx_image: beta-xcode6.2
177 os: osx
178
179 # Xcode 6.3 Clang
180 - env: COMPILER=clang++
181 osx_image: beta-xcode6.3
182 os: osx
183
184 # Xcode 6.4 Clang
185 - env: COMPILER=clang++
186 osx_image: xcode6.4
187 os: osx
188
189 # Xcode 7 Clang
190 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
191 osx_image: xcode7
192 os: osx
193
194 # Xcode 7.1 Clang
195 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
196 osx_image: xcode7.1
197 os: osx
198
199 # Xcode 7.2 Clang
200 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
201 osx_image: xcode7.2
202 os: osx
203
204 # Xcode 7.3 Clang
205 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
206 osx_image: xcode7.3
207 os: osx
208
209 # OSX GCC 4.4
210 - env: COMPILER=g++-4.4
211 compiler: gcc
212 os: osx
213
214 # OSX GCC 4.5
215 - env: COMPILER=g++-4.5
216 compiler: gcc
217 os: osx
218
219 # OSX GCC 4.6
220 - env: COMPILER=g++-4.6
221 compiler: gcc
222 os: osx
223
224 # OSX GCC 4.7
225 - env: COMPILER=g++-4.7
226 compiler: gcc
227 os: osx
228
229 # OSX GCC 4.8
230 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
231 compiler: gcc
232 os: osx
233
234 # OSX GCC 4.9
235 - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
236 compiler: gcc
237 os: osx
238
239 # OSX GCC 5
240 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
241 compiler: gcc
242 os: osx
243
244# # OSX GCC 6
245# - 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 +0300246# compiler: gcc
247# os: osx
onqtam90d95de2016-05-22 04:17:34 +0300248
249 # OSX LLVM-GCC
250 - env: COMPILER=g++
251 compiler: gcc
252 os: osx
onqtame4c75fc2016-05-21 01:24:48 +0300253
onqtam3ffb8872016-06-07 23:46:09 +0300254 allow_failures:
255 # because in the period of the past week (01.06 to 06.06) all ASAN builds started failing with this error:
256 # /usr/bin/ld: unrecognized option '--push-state'
257 # see this question for details - http://stackoverflow.com/questions/37688926/asan-with-g-5-4-0-not-working-on-travis-ci
258 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
259 os: linux
260
onqtame4c75fc2016-05-21 01:24:48 +0300261before_install:
262 - |
263 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
264 brew update
265 # brew install ccache
266 brew install valgrind
267 # cmake
268 if brew list -1 | grep -q "^cmake\$"; then
269 brew outdated cmake || brew upgrade cmake
270 else
271 brew install cmake
272 fi
273 # gcc
274 if [[ "${COMPILER}" = "g++-4.4" ]]; then
275 brew install gcc44
276 fi
277 if [[ "${COMPILER}" = "g++-4.5" ]]; then
278 brew install gcc45
279 fi
280 if [[ "${COMPILER}" = "g++-4.6" ]]; then
281 brew install gcc46
282 fi
283 if [[ "${COMPILER}" = "g++-4.7" ]]; then
284 brew install gcc47
285 fi
286 if [[ "${COMPILER}" = "g++-4.8" ]]; then
287 brew outdated gcc48 || brew upgrade gcc48
288 fi
289 if [[ "${COMPILER}" = "g++-4.9" ]]; then
290 brew install gcc49
291 fi
292 if [[ "${COMPILER}" = "g++-5" ]]; then
293 brew install gcc5
294 fi
295 if [[ "${COMPILER}" = "g++-6" ]]; then
296 brew install gcc6
297 fi
298 fi
299 - git submodule update --init --recursive
300
301install:
302 - ${CXX} --version
303# - export CXX="ccache ${COMPILER}"
304 - export CXX="${COMPILER}"
305 - ${CXX} --version
306# - ccache -s
307
308script:
309 # coverage - do not continue with other build configurations after that
310 - |
311 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
312 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300313 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300314 exit
315 fi
316
317 # initial run with options
318 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} .
319
onqtam1586ea22016-05-21 18:02:26 +0300320 # debug x64
321 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" .
322 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300323 # valgrind for 64bit under osx fails TOO
324 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
325 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300326 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
327 # release x64
328 - cmake -DCMAKE_BUILD_TYPE=Release -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
onqtame4c75fc2016-05-21 01:24:48 +0300334 # debug x86
335 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300336 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300337 # valgrind for 32bit under osx fails
338 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300339 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300340 # release x86
341 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300342 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300343 # valgrind for 32bit under osx fails
344 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300345 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300346
347 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam1586ea22016-05-21 18:02:26 +0300348# - cmake -DTEST_MODE=NORMAL .
349 - cmake -DTEST_MODE=COMPARE .
onqtame4c75fc2016-05-21 01:24:48 +0300350 # on separate commands because when something fails I want to see which one exactly
onqtam316fce22016-05-21 16:57:13 +0300351 - 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
352 - 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
353 - 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
354 - 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
355 - 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
356 - 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
357 - 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
358 - 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 +0300359
360# - ccache -s
361
362after_script:
363 - cat compile_commands.json