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