blob: 8361518986b827e11a8cb0f772904fcf9482e2d9 [file] [log] [blame]
hardlyb1e7e142014-08-06 00:43:51 +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
16env:
17 global:
18 - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
19 # Workaround for https://github.com/travis-ci/travis-ci/issues/4681
20 # "Defining the build matrix only with matrix.include leads to an additional, unwanted job"
21 matrix:
22 - TRAVIS_EMPTY_JOB_WORKAROUND=true
23
24# these apt sources will be referenced later (by using *name)
25addons:
26 apt:
27 sources: &apt_sources
28 - ubuntu-toolchain-r-test
29 - llvm-toolchain-precise-3.5
30 - llvm-toolchain-precise-3.6
31 - llvm-toolchain-precise-3.7
32 - llvm-toolchain-precise
33
34compiler: clang
35os: linux
36
37matrix:
38 exclude:
39 - env: TRAVIS_EMPTY_JOB_WORKAROUND=true
40
41 include:
42 # coverage
43 - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci
44 compiler: gcc
45 addons:
46 apt:
47 packages: ["lcov", "curl"]
48
49 # GCC 4.4
50 - env: COMPILER=g++-4.4
51 compiler: gcc
52 addons: &gcc44
53 apt:
54 packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"]
55 sources: *apt_sources
56
57 # GCC 4.5
58 - env: COMPILER=g++-4.5
59 compiler: gcc
60 addons: &gcc45
61 apt:
62 packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"]
63 sources: *apt_sources
64
65 # GCC 4.6
66 - env: COMPILER=g++-4.6
67 compiler: gcc
68 addons: &gcc46
69 apt:
70 packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"]
71 sources: *apt_sources
72
73 # GCC 4.7
74 - env: COMPILER=g++-4.7
75 compiler: gcc
76 addons: &gcc47
77 apt:
78 packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"]
79 sources: *apt_sources
80
81 # GCC 4.8
82 - env: COMPILER=g++-4.8 HAS_ASAN=true
83 compiler: gcc
84 addons: &gcc48
85 apt:
86 packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"]
87 sources: *apt_sources
88
89 # GCC 4.9
90 - env: COMPILER=g++-4.9 HAS_ASAN=true HAS_UBSAN=true
91 compiler: gcc
92 addons: &gcc49
93 apt:
94 packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"]
95 sources: *apt_sources
96
97 # GCC 5
98 - env: COMPILER=g++-5 HAS_ASAN=true HAS_UBSAN=true
99 compiler: gcc
100 addons: &gcc5
101 apt:
102 packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"]
103 sources: *apt_sources
104
105 # Clang 3.4
onqtam85b58b52016-03-15 11:21:31 +0200106 - env: COMPILER=clang++ # HAS_ASAN=true HAS_UBSAN=true # waiting for libclang-3.4-dev:i386
hardlyb1e7e142014-08-06 00:43:51 +0300107 addons: &clang
108 apt:
109 packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
110 sources: *apt_sources
111
112 # Clang 3.5
onqtamf845c7f2016-04-02 14:15:05 +0300113 - env: COMPILER=clang++-3.5 HAS_ASAN=true HAS_UBSAN=true # waiting for libclang-3.5-dev:i386
hardlyb1e7e142014-08-06 00:43:51 +0300114 addons: &clang35
115 apt:
onqtamf845c7f2016-04-02 14:15:05 +0300116 packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "libclang-3.5-dev:i386"]
hardlyb1e7e142014-08-06 00:43:51 +0300117 sources: *apt_sources
118
119 # Clang 3.6
onqtam85b58b52016-03-15 11:21:31 +0200120 - env: COMPILER=clang++-3.6 # HAS_ASAN=true HAS_UBSAN=true # waiting for libclang-3.6-dev:i386
hardlyb1e7e142014-08-06 00:43:51 +0300121 addons: &clang36
122 apt:
123 packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
124 sources: *apt_sources
125
126 # Clang 3.7
onqtam85b58b52016-03-15 11:21:31 +0200127 - env: COMPILER=clang++-3.7 # HAS_ASAN=true HAS_UBSAN=true # not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
hardlyb1e7e142014-08-06 00:43:51 +0300128 addons: &clang37
129 apt:
130 packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
131 sources: *apt_sources
132
133 # Clang 3.8
onqtam85b58b52016-03-15 11:21:31 +0200134 - env: COMPILER=clang++-3.8 # HAS_ASAN=true HAS_UBSAN=true # not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757
hardlyb1e7e142014-08-06 00:43:51 +0300135 addons: &clang38
136 apt:
137 packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"]
138 sources: *apt_sources
139
140 # Xcode 6.1 Clang
141 - env: COMPILER=clang++
142 os: osx
143
144 # Xcode 6.2 Clang
145 - env: COMPILER=clang++
146 osx_image: beta-xcode6.2
147 os: osx
148
149 # Xcode 6.3 Clang
150 - env: COMPILER=clang++
151 osx_image: beta-xcode6.3
152 os: osx
153
154 # Xcode 6.4 Clang
155 - env: COMPILER=clang++
156 osx_image: xcode6.4
157 os: osx
158
159 # Xcode 7 Clang
160 - env: COMPILER=clang++ HAS_ASAN=true
161 osx_image: xcode7
162 os: osx
163
164 # Xcode 7.1 Clang
165 - env: COMPILER=clang++ HAS_ASAN=true
166 osx_image: xcode7.1
167 os: osx
168
169 # Xcode 7.2 Clang
170 - env: COMPILER=clang++ HAS_ASAN=true
171 osx_image: xcode7.2
172 os: osx
173
174 # Xcode 7.3 Clang
175 - env: COMPILER=clang++ HAS_ASAN=true
176 osx_image: xcode7.3
177 os: osx
178
179 # OSX GCC 4.4
180 - env: COMPILER=g++-4.4
181 compiler: gcc
182 os: osx
183
184 # OSX GCC 4.5
185 - env: COMPILER=g++-4.5
186 compiler: gcc
187 os: osx
188
189 # OSX GCC 4.6
190 - env: COMPILER=g++-4.6
191 compiler: gcc
192 os: osx
193
194 # OSX GCC 4.7
195 - env: COMPILER=g++-4.7
196 compiler: gcc
197 os: osx
198
199 # OSX GCC 4.8
200 - env: COMPILER=g++-4.8 HAS_ASAN=true
201 compiler: gcc
202 os: osx
203
204 # OSX GCC 4.9
205 - env: COMPILER=g++-4.9 HAS_ASAN=true HAS_UBSAN=true
206 compiler: gcc
207 os: osx
208
209 # OSX GCC 5
210 - env: COMPILER=g++-5 HAS_ASAN=true HAS_UBSAN=true
211 compiler: gcc
212 os: osx
213
214 # OSX LLVM-GCC
215 - env: COMPILER=g++
216 compiler: gcc
217 os: osx
218
hardlyb1e7e142014-08-06 00:43:51 +0300219addons:
220 coverity_scan:
221 # COVERITY_SCAN_TOKEN added as env var in travis project
222 project:
223 name: onqtam/doctest
224 notification_email: vik.kirilov@gmail.com
225 build_command_prepend: cd examples/hello_world && cmake .
226 build_command: make
227 branch_pattern: coverity_scan
228
229before_install:
230 - |
231 if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
232 # update package list
233 brew update
234 # valgrind
235 brew install valgrind
236 # cmake
237 if brew list -1 | grep -q "^cmake\$"; then
238 brew outdated cmake || brew upgrade cmake
239 else
240 brew install cmake
241 fi
242 # gcc
243 if [[ "${COMPILER}" = "g++-4.4" ]]; then
244 brew install gcc44
245 fi
246 if [[ "${COMPILER}" = "g++-4.5" ]]; then
247 brew install gcc45
248 fi
249 if [[ "${COMPILER}" = "g++-4.6" ]]; then
250 brew install gcc46
251 fi
252 if [[ "${COMPILER}" = "g++-4.7" ]]; then
253 brew install gcc47
254 fi
255 if [[ "${COMPILER}" = "g++-4.8" ]]; then
256 brew outdated gcc48 || brew upgrade gcc48
257 fi
258 if [[ "${COMPILER}" = "g++-4.9" ]]; then
259 brew install gcc49
260 fi
261 if [[ "${COMPILER}" = "g++-5" ]]; then
262 brew install gcc5
263 fi
264 if [[ "${COMPILER}" = "g++-6" ]]; then
265 brew install gcc6
266 fi
267 fi
268 - git submodule update --init --recursive
269
270install:
271 - ${CXX} --version
272 - export CXX="${COMPILER}"
273 - ${CXX} --version
274
275script:
276 # coverage - do not continue with other build configurations after that
277 - |
278 if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then
279 cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug .
onqtam44cde122016-03-19 14:32:12 +0200280 make -j2 && make coveralls
hardlyb1e7e142014-08-06 00:43:51 +0300281 exit
282 fi
283
284 # initial run with options
285 - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} .
286
287 # debug x86
288 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" .
onqtam44cde122016-03-19 14:32:12 +0200289 - make clean && make -j2
hardlyb1e7e142014-08-06 00:43:51 +0300290 # valgrind for 32bit under osx fails
291 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
292# - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
293 # debug x64
294 - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" .
onqtam44cde122016-03-19 14:32:12 +0200295 - make clean && make -j2
hardlyb1e7e142014-08-06 00:43:51 +0300296 - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
297# - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
298 # release x86
299 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" .
onqtam44cde122016-03-19 14:32:12 +0200300 - make clean && make -j2
hardlyb1e7e142014-08-06 00:43:51 +0300301 # valgrind for 32bit under osx fails
302 - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi
303# - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
304 # release x64
305 - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" .
onqtam44cde122016-03-19 14:32:12 +0200306 - make clean && make -j2
hardlyb1e7e142014-08-06 00:43:51 +0300307 - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure
308# - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure
309
310 # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers
311 - cmake -DTEST_MODE=NORMAL .
312# - cmake -DTEST_MODE=COMPARE .
313 # on separate commands because when something fails I want to see which one exactly
onqtam44cde122016-03-19 14:32:12 +0200314 - if [[ "${HAS_ASAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi
315 - if [[ "${HAS_ASAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi
316 - if [[ "${HAS_ASAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi
317 - if [[ "${HAS_ASAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi
318 - if [[ "${HAS_UBSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi
319 - if [[ "${HAS_UBSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi
320 - if [[ "${HAS_UBSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi
onqtam7c4dbed2016-03-18 18:30:10 +0200321 - if [[ "${HAS_UBSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make -j2 && ctest --output-on-failure ; fi
onqtamf845c7f2016-04-02 14:15:05 +0300322
hardlyb1e7e142014-08-06 00:43:51 +0300323after_script:
324 - cat compile_commands.json