onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 1 | sudo: false |
| 2 | language: c++ |
| 3 | |
| 4 | notifications: |
| 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 |
| 13 | git: |
| 14 | depth: 5 |
| 15 | |
| 16 | cache: |
| 17 | - apt |
| 18 | - ccache |
| 19 | |
| 20 | env: |
| 21 | global: |
| 22 | - USE_CCACHE=1 |
| 23 | - CCACHE_SLOPPINESS=pch_defines,time_macros |
| 24 | - CCACHE_COMPRESS=1 |
| 25 | - CCACHE_MAXSIZE=100M |
| 26 | - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" |
| 27 | # Workaround for https://github.com/travis-ci/travis-ci/issues/4681 |
| 28 | # "Defining the build matrix only with matrix.include leads to an additional, unwanted job" |
| 29 | matrix: |
| 30 | - TRAVIS_EMPTY_JOB_WORKAROUND=true |
| 31 | |
| 32 | # these apt sources will be referenced later (by using *name) |
| 33 | addons: |
| 34 | apt: |
| 35 | sources: &apt_sources |
| 36 | - ubuntu-toolchain-r-test |
| 37 | - llvm-toolchain-precise-3.5 |
| 38 | - llvm-toolchain-precise-3.6 |
| 39 | - llvm-toolchain-precise-3.7 |
| 40 | - llvm-toolchain-precise-3.8 |
| 41 | - llvm-toolchain-precise |
| 42 | |
| 43 | compiler: clang |
| 44 | os: linux |
| 45 | |
| 46 | matrix: |
| 47 | exclude: |
| 48 | - env: TRAVIS_EMPTY_JOB_WORKAROUND=true |
| 49 | |
| 50 | include: |
| 51 | # coverage |
| 52 | - env: COMPILER=g++ COVERALLS_SERVICE_NAME=travis-ci |
| 53 | compiler: gcc |
| 54 | addons: |
| 55 | apt: |
| 56 | packages: ["lcov", "curl"] |
| 57 | |
| 58 | # GCC 4.4 |
| 59 | - env: COMPILER=g++-4.4 |
| 60 | compiler: gcc |
| 61 | addons: &gcc44 |
| 62 | apt: |
| 63 | packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 64 | sources: *apt_sources |
| 65 | |
| 66 | # GCC 4.5 |
| 67 | - env: COMPILER=g++-4.5 |
| 68 | compiler: gcc |
| 69 | addons: &gcc45 |
| 70 | apt: |
| 71 | packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 72 | sources: *apt_sources |
| 73 | |
| 74 | # GCC 4.6 |
| 75 | - env: COMPILER=g++-4.6 |
| 76 | compiler: gcc |
| 77 | addons: &gcc46 |
| 78 | apt: |
| 79 | packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 80 | sources: *apt_sources |
| 81 | |
| 82 | # GCC 4.7 |
| 83 | - env: COMPILER=g++-4.7 |
| 84 | compiler: gcc |
| 85 | addons: &gcc47 |
| 86 | apt: |
| 87 | packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 88 | sources: *apt_sources |
| 89 | |
| 90 | # GCC 4.8 |
| 91 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 92 | compiler: gcc |
| 93 | addons: &gcc48 |
| 94 | apt: |
| 95 | packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 96 | sources: *apt_sources |
| 97 | |
| 98 | # GCC 4.9 |
| 99 | - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 100 | compiler: gcc |
| 101 | addons: &gcc49 |
| 102 | apt: |
| 103 | packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 104 | sources: *apt_sources |
| 105 | |
| 106 | # GCC 5 |
| 107 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 108 | compiler: gcc |
| 109 | addons: &gcc5 |
| 110 | apt: |
| 111 | packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 112 | sources: *apt_sources |
| 113 | |
| 114 | # # GCC 6 |
| 115 | # # released on 2016.04.27 |
| 116 | # # wait for it to enter the whitelist - https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise |
| 117 | # # also with homebrew under OSX!!! |
| 118 | # - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 119 | # compiler: gcc |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 120 | # addons: &gcc6 |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 121 | # apt: |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 122 | # packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 123 | # sources: *apt_sources |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 124 | |
| 125 | # Clang 3.4 |
| 126 | - env: COMPILER=clang++ HAS_ASAN_64=true HAS_UBSAN_64=true |
| 127 | addons: &clang |
| 128 | apt: |
| 129 | packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 130 | sources: *apt_sources |
| 131 | |
| 132 | # Clang 3.5 |
| 133 | - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 134 | addons: &clang35 |
| 135 | apt: |
| 136 | packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 137 | sources: *apt_sources |
| 138 | |
| 139 | # Clang 3.6 |
| 140 | - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 141 | addons: &clang36 |
| 142 | apt: |
| 143 | packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 144 | sources: *apt_sources |
| 145 | |
| 146 | # Clang 3.7 |
| 147 | - env: COMPILER=clang++-3.7 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757 |
| 148 | addons: &clang37 |
| 149 | apt: |
| 150 | packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 151 | sources: *apt_sources |
| 152 | |
| 153 | # Clang 3.8 |
| 154 | - env: COMPILER=clang++-3.8 # no sanitizers - not even for 64 bit - https://llvm.org/bugs/show_bug.cgi?id=22757 |
| 155 | addons: &clang38 |
| 156 | apt: |
| 157 | packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 158 | sources: *apt_sources |
| 159 | |
| 160 | # Xcode 6.1 Clang |
| 161 | - env: COMPILER=clang++ |
| 162 | os: osx |
| 163 | |
| 164 | # Xcode 6.2 Clang |
| 165 | - env: COMPILER=clang++ |
| 166 | osx_image: beta-xcode6.2 |
| 167 | os: osx |
| 168 | |
| 169 | # Xcode 6.3 Clang |
| 170 | - env: COMPILER=clang++ |
| 171 | osx_image: beta-xcode6.3 |
| 172 | os: osx |
| 173 | |
| 174 | # Xcode 6.4 Clang |
| 175 | - env: COMPILER=clang++ |
| 176 | osx_image: xcode6.4 |
| 177 | os: osx |
| 178 | |
| 179 | # Xcode 7 Clang |
| 180 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 181 | osx_image: xcode7 |
| 182 | os: osx |
| 183 | |
| 184 | # Xcode 7.1 Clang |
| 185 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 186 | osx_image: xcode7.1 |
| 187 | os: osx |
| 188 | |
| 189 | # Xcode 7.2 Clang |
| 190 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 191 | osx_image: xcode7.2 |
| 192 | os: osx |
| 193 | |
| 194 | # Xcode 7.3 Clang |
| 195 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 196 | osx_image: xcode7.3 |
| 197 | os: osx |
| 198 | |
| 199 | # OSX GCC 4.4 |
| 200 | - env: COMPILER=g++-4.4 |
| 201 | compiler: gcc |
| 202 | os: osx |
| 203 | |
| 204 | # OSX GCC 4.5 |
| 205 | - env: COMPILER=g++-4.5 |
| 206 | compiler: gcc |
| 207 | os: osx |
| 208 | |
| 209 | # OSX GCC 4.6 |
| 210 | - env: COMPILER=g++-4.6 |
| 211 | compiler: gcc |
| 212 | os: osx |
| 213 | |
| 214 | # OSX GCC 4.7 |
| 215 | - env: COMPILER=g++-4.7 |
| 216 | compiler: gcc |
| 217 | os: osx |
| 218 | |
| 219 | # OSX GCC 4.8 |
| 220 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 221 | compiler: gcc |
| 222 | os: osx |
| 223 | |
| 224 | # OSX GCC 4.9 |
| 225 | - env: COMPILER=g++-4.9 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 226 | compiler: gcc |
| 227 | os: osx |
| 228 | |
| 229 | # OSX GCC 5 |
| 230 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 231 | compiler: gcc |
| 232 | os: osx |
| 233 | |
| 234 | # # OSX GCC 6 |
| 235 | # - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 695fded | 2016-04-30 15:14:08 +0300 | [diff] [blame] | 236 | # compiler: gcc |
| 237 | # os: osx |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 238 | |
| 239 | # OSX LLVM-GCC |
| 240 | - env: COMPILER=g++ |
| 241 | compiler: gcc |
| 242 | os: osx |
| 243 | |
| 244 | addons: |
| 245 | coverity_scan: |
| 246 | # COVERITY_SCAN_TOKEN added as env var in travis project |
| 247 | project: |
| 248 | name: onqtam/doctest |
| 249 | notification_email: vik.kirilov@gmail.com |
| 250 | build_command_prepend: cd examples/hello_world && cmake . |
| 251 | build_command: make |
| 252 | branch_pattern: coverity_scan |
| 253 | |
| 254 | before_install: |
| 255 | - | |
| 256 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 257 | # update package list |
| 258 | brew update |
onqtam | e835b42 | 2016-05-09 15:42:00 +0300 | [diff] [blame^] | 259 | # ccache |
| 260 | brew install ccache |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 261 | # valgrind |
| 262 | brew install valgrind |
| 263 | # cmake |
| 264 | if brew list -1 | grep -q "^cmake\$"; then |
| 265 | brew outdated cmake || brew upgrade cmake |
| 266 | else |
| 267 | brew install cmake |
| 268 | fi |
| 269 | # gcc |
| 270 | if [[ "${COMPILER}" = "g++-4.4" ]]; then |
| 271 | brew install gcc44 |
| 272 | fi |
| 273 | if [[ "${COMPILER}" = "g++-4.5" ]]; then |
| 274 | brew install gcc45 |
| 275 | fi |
| 276 | if [[ "${COMPILER}" = "g++-4.6" ]]; then |
| 277 | brew install gcc46 |
| 278 | fi |
| 279 | if [[ "${COMPILER}" = "g++-4.7" ]]; then |
| 280 | brew install gcc47 |
| 281 | fi |
| 282 | if [[ "${COMPILER}" = "g++-4.8" ]]; then |
| 283 | brew outdated gcc48 || brew upgrade gcc48 |
| 284 | fi |
| 285 | if [[ "${COMPILER}" = "g++-4.9" ]]; then |
| 286 | brew install gcc49 |
| 287 | fi |
| 288 | if [[ "${COMPILER}" = "g++-5" ]]; then |
| 289 | brew install gcc5 |
| 290 | fi |
| 291 | if [[ "${COMPILER}" = "g++-6" ]]; then |
| 292 | brew install gcc6 |
| 293 | fi |
| 294 | fi |
| 295 | - git submodule update --init --recursive |
| 296 | |
| 297 | install: |
| 298 | - ${CXX} --version |
onqtam | e835b42 | 2016-05-09 15:42:00 +0300 | [diff] [blame^] | 299 | - export CXX="ccache ${COMPILER}" |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 300 | - ${CXX} --version |
| 301 | - ccache -s |
| 302 | |
| 303 | script: |
| 304 | # coverage - do not continue with other build configurations after that |
| 305 | - | |
| 306 | if [[ "${COVERALLS_SERVICE_NAME}" = "travis-ci" ]]; then |
| 307 | cmake ${CMAKE_OPTIONS_GLOBAL} -DCMAKE_BUILD_TYPE=Debug . |
| 308 | make -j2 && make coveralls |
| 309 | exit |
| 310 | fi |
| 311 | |
| 312 | # initial run with options |
| 313 | - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} . |
| 314 | |
| 315 | # debug x86 |
| 316 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32" . |
| 317 | - make clean && make -j2 |
| 318 | # valgrind for 32bit under osx fails |
| 319 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 320 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 321 | # debug x64 |
| 322 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64" . |
| 323 | - make clean && make -j2 |
| 324 | - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure |
| 325 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 326 | # release x86 |
| 327 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32" . |
| 328 | - make clean && make -j2 |
| 329 | # valgrind for 32bit under osx fails |
| 330 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 331 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 332 | # release x64 |
| 333 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64" . |
| 334 | - make clean && make -j2 |
| 335 | - cmake -DTEST_MODE=VALGRIND . && ctest --output-on-failure |
| 336 | # - cmake -DTEST_MODE=COMPARE . && ctest --output-on-failure |
| 337 | |
| 338 | # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers |
| 339 | - cmake -DTEST_MODE=NORMAL . |
| 340 | # - cmake -DTEST_MODE=COMPARE . |
| 341 | # on separate commands because when something fails I want to see which one exactly |
| 342 | - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 343 | - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 344 | - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 345 | - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=address" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 346 | - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 347 | - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
| 348 | - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m64 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
onqtam | e835b42 | 2016-05-09 15:42:00 +0300 | [diff] [blame^] | 349 | - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-m32 -fsanitize=undefined" . && make clean && make -j2 && ctest --output-on-failure ; fi |
onqtam | 7584cf2 | 2016-05-08 17:52:31 +0300 | [diff] [blame] | 350 | |
| 351 | after_script: |
| 352 | - cat compile_commands.json |