blob: 3609140a021af36e6bd69c63c408f2a61a78afa1 [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
onqtamd19d6da2016-06-26 15:49:12 +030046 #- 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
onqtame2f60b02016-06-18 19:17:18 +0300116 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true SANITIZER_CXX_FLAGS=-fuse-ld=gold
onqtam90d95de2016-05-22 04:17:34 +0300117 compiler: gcc
118 addons: &gcc5
119 apt:
onqtam959458c2016-06-18 14:56:40 +0300120 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
onqtame2f60b02016-06-18 19:17:18 +0300124 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true SANITIZER_CXX_FLAGS=-fuse-ld=gold
onqtam3b2f7982016-06-15 20:07:50 +0300125 compiler: gcc
126 addons: &gcc6
127 apt:
128 packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"]
129 sources: ubuntu-toolchain-r-test
onqtam90d95de2016-05-22 04:17:34 +0300130
onqtam5bb6fcc2016-06-10 21:35:44 +0300131 # Clang 3.4
132 - env: COMPILER=clang++ HAS_ASAN_64=true HAS_UBSAN_64=true
133 addons: &clang
134 apt:
135 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
136
137 # Clang 3.5
onqtamd19d6da2016-06-26 15:49:12 +0300138 - env: COMPILER=clang++-3.5 LLVM_VERSION=3.5.2 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam5bb6fcc2016-06-10 21:35:44 +0300139 addons: &clang35
140 apt:
onqtamd19d6da2016-06-26 15:49:12 +0300141 #packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
142 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300143 sources: *llvm_apt_sources
144
145 # Clang 3.6
onqtamd19d6da2016-06-26 15:49:12 +0300146 - env: COMPILER=clang++-3.6 LLVM_VERSION=3.6.2 HAS_ASAN_64=true HAS_UBSAN_64=true
onqtam5bb6fcc2016-06-10 21:35:44 +0300147 addons: &clang36
148 apt:
onqtamd19d6da2016-06-26 15:49:12 +0300149 #packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
150 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300151 sources: *llvm_apt_sources
152
153 # Clang 3.7
onqtamd19d6da2016-06-26 15:49:12 +0300154 - env: COMPILER=clang++-3.7 LLVM_VERSION=3.7.1 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
onqtam5bb6fcc2016-06-10 21:35:44 +0300155 addons: &clang37
156 apt:
onqtamd19d6da2016-06-26 15:49:12 +0300157 #packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
158 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300159 sources: *llvm_apt_sources
160
161 # Clang 3.8
onqtamd19d6da2016-06-26 15:49:12 +0300162 - env: COMPILER=clang++-3.8 LLVM_VERSION=3.8.0 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
onqtam5bb6fcc2016-06-10 21:35:44 +0300163 addons: &clang38
164 apt:
onqtamd19d6da2016-06-26 15:49:12 +0300165 #packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
166 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
onqtam5bb6fcc2016-06-10 21:35:44 +0300167 sources: *llvm_apt_sources
onqtam90d95de2016-05-22 04:17:34 +0300168
169 # Xcode 6.1 Clang
170 - env: COMPILER=clang++
171 os: osx
172
173 # Xcode 6.2 Clang
174 - env: COMPILER=clang++
175 osx_image: beta-xcode6.2
176 os: osx
177
178 # Xcode 6.3 Clang
179 - env: COMPILER=clang++
180 osx_image: beta-xcode6.3
181 os: osx
182
183 # Xcode 6.4 Clang
184 - env: COMPILER=clang++
185 osx_image: xcode6.4
186 os: osx
187
188 # Xcode 7 Clang
189 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
190 osx_image: xcode7
191 os: osx
192
193 # Xcode 7.1 Clang
194 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
195 osx_image: xcode7.1
196 os: osx
197
198 # Xcode 7.2 Clang
199 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
200 osx_image: xcode7.2
201 os: osx
202
203 # Xcode 7.3 Clang
204 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
205 osx_image: xcode7.3
206 os: osx
207
onqtam692541c2016-06-14 09:58:04 +0300208 # Xcode 8 Clang
209 - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true
210 osx_image: xcode8
211 os: osx
212
onqtam90d95de2016-05-22 04:17:34 +0300213 # OSX GCC 4.4
214 - env: COMPILER=g++-4.4
215 compiler: gcc
216 os: osx
217
218 # OSX GCC 4.5
219 - env: COMPILER=g++-4.5
220 compiler: gcc
221 os: osx
222
223 # OSX GCC 4.6
224 - env: COMPILER=g++-4.6
225 compiler: gcc
226 os: osx
227
228 # OSX GCC 4.7
229 - env: COMPILER=g++-4.7
230 compiler: gcc
231 os: osx
232
233 # OSX GCC 4.8
234 - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true
235 compiler: gcc
236 os: osx
237
238 # OSX GCC 4.9
239 - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
240 compiler: gcc
241 os: osx
242
243 # OSX GCC 5
244 - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
245 compiler: gcc
246 os: osx
247
onqtam3b2f7982016-06-15 20:07:50 +0300248 # OSX GCC 6
249 - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true
250 compiler: gcc
251 os: osx
onqtam90d95de2016-05-22 04:17:34 +0300252
253 # OSX LLVM-GCC
254 - env: COMPILER=g++
255 compiler: gcc
256 os: osx
onqtame4c75fc2016-05-21 01:24:48 +0300257
onqtam3ffb8872016-06-07 23:46:09 +0300258 allow_failures:
onqtam3ffb8872016-06-07 23:46:09 +0300259
onqtame4c75fc2016-05-21 01:24:48 +0300260before_install:
261 - |
262 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
263 brew update
264 # brew install ccache
265 brew install valgrind
266 # cmake
267 if brew list -1 | grep -q "^cmake\$"; then
268 brew outdated cmake || brew upgrade cmake
269 else
270 brew install cmake
271 fi
272 # gcc
273 if [[ "${COMPILER}" = "g++-4.4" ]]; then
274 brew install gcc44
275 fi
276 if [[ "${COMPILER}" = "g++-4.5" ]]; then
277 brew install gcc45
278 fi
279 if [[ "${COMPILER}" = "g++-4.6" ]]; then
280 brew install gcc46
281 fi
282 if [[ "${COMPILER}" = "g++-4.7" ]]; then
283 brew install gcc47
284 fi
285 if [[ "${COMPILER}" = "g++-4.8" ]]; then
286 brew outdated gcc48 || brew upgrade gcc48
287 fi
288 if [[ "${COMPILER}" = "g++-4.9" ]]; then
289 brew install gcc49
290 fi
291 if [[ "${COMPILER}" = "g++-5" ]]; then
292 brew install gcc5
293 fi
294 if [[ "${COMPILER}" = "g++-6" ]]; then
295 brew install gcc6
296 fi
297 fi
298 - git submodule update --init --recursive
299
300install:
onqtamd19d6da2016-06-26 15:49:12 +0300301 - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
302 - mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
303 - |
304 if [[ "${LLVM_VERSION}" != "" ]]; then
305 CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
306 mkdir clang && travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C clang
307 export PATH="${DEPS_DIR}/clang/bin:${PATH}"
308 fi
onqtame4c75fc2016-05-21 01:24:48 +0300309# - export CXX="ccache ${COMPILER}"
310 - export CXX="${COMPILER}"
311 - ${CXX} --version
312# - ccache -s
313
314script:
315 # coverage - do not continue with other build configurations after that
316 - |
317 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
318 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam316fce22016-05-21 16:57:13 +0300319 make -k -j2 && make coveralls
onqtame4c75fc2016-05-21 01:24:48 +0300320 exit
321 fi
322
323 # initial run with options
324 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} .
325
onqtam1586ea22016-05-21 18:02:26 +0300326 # debug x64
327 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" .
328 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300329 # valgrind for 64bit under osx fails TOO
330 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
331 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300332 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
333 # release x64
334 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" .
335 - make clean && make -k -j2
onqtam8e44b182016-05-22 05:28:31 +0300336 # valgrind for 64bit under osx fails TOO
337 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
338 # - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
onqtam1586ea22016-05-21 18:02:26 +0300339 - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
onqtame4c75fc2016-05-21 01:24:48 +0300340 # debug x86
341 - cmake -DCMAKE_BUILD_TYPE=Debug -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 # release x86
347 - cmake -DCMAKE_BUILD_TYPE=Release -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
353 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
onqtam1586ea22016-05-21 18:02:26 +0300354 - cmake -DTEST_MODE=COMPARE .
onqtame4c75fc2016-05-21 01:24:48 +0300355 # on separate commands because when something fails I want to see which one exactly
onqtame2f60b02016-06-18 19:17:18 +0300356 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m64 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
357 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m32 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
358 - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m64 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
359 - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m32 -fsanitize=address" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
360 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m64 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
361 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m32 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
362 - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m64 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
363 - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${SANITIZER_CXX_FLAGS} -m32 -fsanitize=undefined" . && make clean && make -k -j2 && ctest --output-on-failure ; fi
onqtame4c75fc2016-05-21 01:24:48 +0300364
365# - ccache -s
366
onqtam2dd55282016-06-13 18:05:38 +0300367#after_script:
368# - cat compile_commands.json