blob: 7af98d86f0edbc70b1c6b072d6bf9dd2f28e07d8 [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
254before_install:
255 - |
256 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
257 brew update
258 # brew install ccache
259 brew install valgrind
260 # cmake
261 if brew list -1 | grep -q "^cmake\$"; then
262 brew outdated cmake || brew upgrade cmake
263 else
264 brew install cmake
265 fi
266 # gcc
267 if [[ "${COMPILER}" = "g++-4.4" ]]; then
268 brew install gcc44
269 fi
270 if [[ "${COMPILER}" = "g++-4.5" ]]; then
271 brew install gcc45
272 fi
273 if [[ "${COMPILER}" = "g++-4.6" ]]; then
274 brew install gcc46
275 fi
276 if [[ "${COMPILER}" = "g++-4.7" ]]; then
277 brew install gcc47
278 fi
279 if [[ "${COMPILER}" = "g++-4.8" ]]; then
280 brew outdated gcc48 || brew upgrade gcc48
281 fi
282 if [[ "${COMPILER}" = "g++-4.9" ]]; then
283 brew install gcc49
284 fi
285 if [[ "${COMPILER}" = "g++-5" ]]; then
286 brew install gcc5
287 fi
288 if [[ "${COMPILER}" = "g++-6" ]]; then
289 brew install gcc6
290 fi
291 fi
292 - git submodule update --init --recursive
293
294install:
295 - ${CXX} --version
296# - export CXX="ccache ${COMPILER}"
297 - export CXX="${COMPILER}"
298 - ${CXX} --version
299# - ccache -s
300
301script:
302 # coverage - do not continue with other build configurations after that
303 - |
304 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
305 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300306 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300307 exit
308 fi
309
310 # initial run with options
311 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} .
312
onqtam1586ea22016-05-21 18:02:26 +0300313 # debug x64
314 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" .
315 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300316 # valgrind for 64bit under osx fails TOO
317 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
318 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300319 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
320 # release x64
321 - cmake -DCMAKE_BUILD_TYPE=Release -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
onqtame4c75fc2016-05-21 01:24:48 +0300327 # debug x86
328 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300329 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300330 # valgrind for 32bit under osx fails
331 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300332 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300333 # release x86
334 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" .
onqtam316fce22016-05-21 16:57:13 +0300335 - make clean && make -k -j2
onqtame4c75fc2016-05-21 01:24:48 +0300336 # valgrind for 32bit under osx fails
337 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
onqtam1586ea22016-05-21 18:02:26 +0300338 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300339
340 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam1586ea22016-05-21 18:02:26 +0300341# - cmake -DTEST_MODE=NORMAL .
342 - cmake -DTEST_MODE=COMPARE .
onqtame4c75fc2016-05-21 01:24:48 +0300343 # on separate commands because when something fails I want to see which one exactly
onqtam316fce22016-05-21 16:57:13 +0300344 - 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
345 - 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
346 - 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
347 - 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
348 - 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
349 - 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
350 - 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
351 - 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 +0300352
353# - ccache -s
354
355after_script:
356 - cat compile_commands.json