onqtam | e85b1bb | 2016-06-26 16:41:09 +0300 | [diff] [blame] | 1 | # this file is HEAVILY influenced by https://github.com/boostorg/hana/blob/master/.travis.yml |
| 2 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 3 | dist: trusty |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 4 | sudo: false |
| 5 | language: c++ |
| 6 | |
| 7 | notifications: |
onqtam | f516977 | 2016-09-09 18:33:13 +0300 | [diff] [blame] | 8 | email: false |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 9 | # gitter |
| 10 | webhooks: |
| 11 | urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706 |
| 12 | on_success: change |
| 13 | on_failure: always |
| 14 | git: |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 15 | depth: 500 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 16 | |
| 17 | # both apt and ccache make the builds slower... |
| 18 | #cache: |
| 19 | # - apt |
| 20 | # - ccache |
| 21 | |
| 22 | env: |
| 23 | global: |
| 24 | # - USE_CCACHE=1 |
| 25 | # - CCACHE_SLOPPINESS=pch_defines,time_macros |
| 26 | # - CCACHE_COMPRESS=1 |
| 27 | # - CCACHE_MAXSIZE=200M |
| 28 | # - CCACHE_CPP2=1 |
| 29 | - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 30 | |
| 31 | addons: |
| 32 | coverity_scan: |
| 33 | # COVERITY_SCAN_TOKEN added as env var in travis project |
| 34 | project: |
| 35 | name: onqtam/doctest |
| 36 | notification_email: vik.kirilov@gmail.com |
onqtam | 92a9ce1 | 2017-05-29 23:56:22 +0300 | [diff] [blame] | 37 | build_command: clang++ scripts/hello_world.cpp -I doctest |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 38 | branch_pattern: coverity_scan |
| 39 | # these apt sources will be referenced later (by using *name) |
| 40 | apt: |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 41 | sources: &apt_sources |
| 42 | - ubuntu-toolchain-r-test |
onqtam | 3bf83c4 | 2017-04-23 15:30:23 +0300 | [diff] [blame] | 43 | - llvm-toolchain-trusty |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 44 | - llvm-toolchain-trusty-3.9 |
onqtam | 3bf83c4 | 2017-04-23 15:30:23 +0300 | [diff] [blame] | 45 | - llvm-toolchain-trusty-4.0 |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 46 | - llvm-toolchain-trusty-5.0 |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 47 | - llvm-toolchain-trusty-6.0 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 48 | |
| 49 | compiler: clang |
| 50 | os: linux |
| 51 | |
| 52 | matrix: |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 53 | include: |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 54 | # coverage |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 55 | - env: COMPILER=g++ CODE_COVERAGE=true |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 56 | compiler: gcc |
| 57 | addons: |
| 58 | apt: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 59 | packages: ["lcov"] |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 60 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 61 | # static code analysis |
| 62 | - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 63 | addons: &clang40 |
| 64 | apt: |
| 65 | packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"] |
| 66 | sources: *apt_sources |
| 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 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 76 | # GCC 4.6 |
| 77 | - env: COMPILER=g++-4.6 |
| 78 | compiler: gcc |
| 79 | addons: &gcc46 |
| 80 | apt: |
| 81 | packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 82 | sources: *apt_sources |
| 83 | |
| 84 | # GCC 4.7 |
| 85 | - env: COMPILER=g++-4.7 |
| 86 | compiler: gcc |
| 87 | addons: &gcc47 |
| 88 | apt: |
| 89 | packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 90 | sources: *apt_sources |
| 91 | |
| 92 | # GCC 4.8 |
| 93 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 94 | compiler: gcc |
| 95 | addons: &gcc48 |
| 96 | apt: |
| 97 | packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 98 | sources: *apt_sources |
| 99 | |
| 100 | # GCC 4.9 |
| 101 | - env: COMPILER=g++-4.9 HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true # no ASAN_32 - errors when using ASAN_OPTIONS - probably g++ 4.9 bug |
| 102 | compiler: gcc |
| 103 | addons: &gcc49 |
| 104 | apt: |
| 105 | packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 106 | sources: *apt_sources |
| 107 | |
| 108 | # GCC 5 |
| 109 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold" |
| 110 | compiler: gcc |
| 111 | addons: &gcc5 |
| 112 | apt: |
| 113 | packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 114 | sources: *apt_sources |
| 115 | |
| 116 | # GCC 6 |
| 117 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold" |
| 118 | compiler: gcc |
| 119 | addons: &gcc6 |
| 120 | apt: |
| 121 | packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 122 | sources: *apt_sources |
| 123 | |
| 124 | # GCC 7 |
| 125 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold" |
| 126 | compiler: gcc |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 127 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 128 | addons: &gcc7 |
| 129 | apt: |
| 130 | packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 131 | sources: *apt_sources |
| 132 | |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 133 | # GCC 8 |
| 134 | - env: COMPILER=g++-8 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold" |
| 135 | compiler: gcc |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 136 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 137 | addons: &gcc8 |
| 138 | apt: |
| 139 | packages: ["g++-8", "valgrind", "g++-8-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 140 | sources: *apt_sources |
| 141 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 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", "g++-6"] |
| 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", "g++-6"] |
| 154 | sources: *apt_sources |
| 155 | |
| 156 | # Clang 3.7 |
| 157 | - env: COMPILER=clang++-3.7 |
| 158 | addons: &clang37 |
| 159 | apt: |
| 160 | packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 161 | sources: *apt_sources |
| 162 | |
| 163 | # Clang 3.8 |
| 164 | - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 165 | addons: &clang38 |
| 166 | apt: |
| 167 | packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 168 | sources: *apt_sources |
| 169 | |
| 170 | # Clang 3.9 |
| 171 | - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 172 | addons: &clang39 |
| 173 | apt: |
| 174 | packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 175 | sources: *apt_sources |
| 176 | |
| 177 | # Clang 4.0 |
| 178 | - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 179 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 180 | addons: &clang40 |
| 181 | apt: |
| 182 | packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 183 | sources: *apt_sources |
| 184 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 185 | # Clang 5.0 |
| 186 | - env: COMPILER=clang++-5.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 187 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 188 | addons: &clang50 |
| 189 | apt: |
| 190 | packages: ["clang-5.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 191 | sources: *apt_sources |
| 192 | |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 193 | # Clang 6.0 |
| 194 | - env: COMPILER=clang++-6.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 195 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 196 | addons: &clang60 |
| 197 | apt: |
| 198 | packages: ["clang-6.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 199 | sources: *apt_sources |
| 200 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 201 | # Xcode 6.4 Clang |
| 202 | - env: COMPILER=clang++ |
| 203 | osx_image: xcode6.4 |
| 204 | os: osx |
| 205 | |
| 206 | # Xcode 7.3 Clang |
| 207 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 208 | osx_image: xcode7.3 |
| 209 | os: osx |
| 210 | |
| 211 | # Xcode 8 Clang |
| 212 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 213 | osx_image: xcode8 |
| 214 | os: osx |
| 215 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 216 | # Xcode 8.3 Clang |
| 217 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 218 | osx_image: xcode8.3 |
| 219 | os: osx |
| 220 | |
onqtam | 8603d87 | 2017-10-06 10:53:25 +0300 | [diff] [blame] | 221 | # Xcode 9 Clang |
| 222 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 223 | osx_image: xcode9 |
| 224 | os: osx |
| 225 | |
| 226 | # Xcode 9.1 Clang |
| 227 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 228 | osx_image: xcode9.1 |
| 229 | os: osx |
| 230 | |
onqtam | 50cbb80 | 2017-12-09 17:17:39 +0200 | [diff] [blame] | 231 | # Xcode 9.2 Clang |
| 232 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 233 | osx_image: xcode9.2 |
| 234 | os: osx |
| 235 | |
onqtam | 3a3bc20 | 2018-04-10 13:54:28 +0300 | [diff] [blame] | 236 | # Xcode 9.3 Clang |
| 237 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 238 | osx_image: xcode9.3 |
| 239 | os: osx |
| 240 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 241 | # OSX GCC 4.9 |
| 242 | - env: COMPILER=g++-4.9 HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true # no ASAN_32 - errors when using ASAN_OPTIONS - probably g++ 4.9 bug |
| 243 | compiler: gcc |
| 244 | osx_image: xcode6.4 |
| 245 | os: osx |
| 246 | |
| 247 | # OSX GCC 5 |
| 248 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 249 | compiler: gcc |
| 250 | osx_image: xcode7.3 |
| 251 | os: osx |
| 252 | |
| 253 | # OSX GCC 6 |
| 254 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 255 | compiler: gcc |
| 256 | osx_image: xcode7.3 |
| 257 | os: osx |
| 258 | |
| 259 | # OSX GCC 7 |
| 260 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 261 | compiler: gcc |
| 262 | osx_image: xcode7.3 |
| 263 | os: osx |
| 264 | |
| 265 | # OSX LLVM-GCC |
| 266 | - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 267 | compiler: gcc |
| 268 | os: osx |
| 269 | |
| 270 | allow_failures: |
| 271 | |
onqtam | b2991d8 | 2018-02-07 00:18:12 +0200 | [diff] [blame] | 272 | # GCC 7 |
| 273 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold" |
| 274 | compiler: gcc |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 275 | sudo: required |
onqtam | b2991d8 | 2018-02-07 00:18:12 +0200 | [diff] [blame] | 276 | |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 277 | # GCC 8 |
| 278 | - env: COMPILER=g++-8 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true ADDITIONAL_CXX_FLAGS=" -fuse-ld=gold" |
| 279 | compiler: gcc |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 280 | sudo: required |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 281 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 282 | # Clang 3.7 |
| 283 | - env: COMPILER=clang++-3.7 |
| 284 | |
| 285 | # Clang 3.9 |
| 286 | - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 287 | |
onqtam | b2991d8 | 2018-02-07 00:18:12 +0200 | [diff] [blame] | 288 | # Clang 4.0 |
| 289 | - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 290 | sudo: required |
onqtam | b2991d8 | 2018-02-07 00:18:12 +0200 | [diff] [blame] | 291 | |
| 292 | # Clang 5.0 |
| 293 | - env: COMPILER=clang++-5.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 294 | sudo: required |
onqtam | b2991d8 | 2018-02-07 00:18:12 +0200 | [diff] [blame] | 295 | |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 296 | # Clang 6.0 |
| 297 | - env: COMPILER=clang++-6.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame^] | 298 | sudo: required |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 299 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 300 | # OSX GCC 6 |
| 301 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 302 | compiler: gcc |
| 303 | osx_image: xcode7.3 |
| 304 | os: osx |
| 305 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 306 | # OSX GCC 7 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 307 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 308 | compiler: gcc |
| 309 | osx_image: xcode7.3 |
| 310 | os: osx |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 311 | |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 312 | install: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 313 | - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi |
| 314 | |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 315 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 316 | # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ |
| 317 | ############################################################################ |
| 318 | |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 319 | # Make a dir for all |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 320 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" |
| 321 | - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} |
| 322 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 323 | # Install a recent CMake |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 324 | - | |
| 325 | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then |
onqtam | 8401535 | 2017-03-15 20:11:07 +0200 | [diff] [blame] | 326 | CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz" |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 327 | mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake |
| 328 | export PATH=${DEPS_DIR}/cmake/bin:${PATH} |
| 329 | fi |
| 330 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 331 | # Install OCLint |
| 332 | - | |
| 333 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
| 334 | OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz" |
| 335 | mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint |
| 336 | export PATH=${DEPS_DIR}/oclint/bin:${PATH} |
| 337 | fi |
| 338 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 339 | # Go back to ${TRAVIS_BUILD_DIR} |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 340 | - cd ${TRAVIS_BUILD_DIR} |
| 341 | |
| 342 | ############################################################################ |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 343 | # Install stuff with homebrew under OSX |
| 344 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 345 | |
onqtam | 23c6a34 | 2016-06-28 14:09:10 +0300 | [diff] [blame] | 346 | - | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 347 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 348 | brew update |
| 349 | # brew install ccache |
onqtam | 27a8c08 | 2017-04-04 17:42:41 +0300 | [diff] [blame] | 350 | # brew install valgrind |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 351 | # cmake |
| 352 | if brew list -1 | grep -q "^cmake\$"; then |
| 353 | brew outdated cmake || brew upgrade cmake |
| 354 | else |
| 355 | brew install cmake |
| 356 | fi |
| 357 | # gcc |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 358 | if [[ "${COMPILER}" = "g++-4.6" ]]; then |
| 359 | brew install gcc46 |
| 360 | fi |
| 361 | if [[ "${COMPILER}" = "g++-4.7" ]]; then |
| 362 | brew install gcc47 |
| 363 | fi |
| 364 | if [[ "${COMPILER}" = "g++-4.8" ]]; then |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 365 | brew install gcc48 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 366 | fi |
| 367 | if [[ "${COMPILER}" = "g++-4.9" ]]; then |
| 368 | brew install gcc49 |
| 369 | fi |
| 370 | if [[ "${COMPILER}" = "g++-5" ]]; then |
| 371 | brew install gcc5 |
| 372 | fi |
| 373 | if [[ "${COMPILER}" = "g++-6" ]]; then |
| 374 | brew install gcc6 |
| 375 | fi |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame] | 376 | if [[ "${COMPILER}" = "g++-7" ]]; then |
| 377 | brew install gcc7 |
| 378 | fi |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 379 | fi |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 380 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 381 | - export CXX="${COMPILER}" |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 382 | # - export CXX="ccache ${COMPILER}" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 383 | # - ccache -s |
onqtam | 7dec6aa | 2016-06-26 16:01:15 +0300 | [diff] [blame] | 384 | |
| 385 | before_script: |
| 386 | - ${CXX} --version |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 387 | |
| 388 | script: |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 389 | # coverage |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 390 | - | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 391 | if [[ "${CODE_COVERAGE}" = "true" ]]; then |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 392 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -std=c++98" -DCMAKE_BUILD_TYPE=Debug . || exit 1 |
| 393 | make -k -j2 || exit 1 |
| 394 | ctest --output-on-failure || exit 1 |
| 395 | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 396 | lcov -d . -c -o coverage.info # parse coverage data |
| 397 | lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files |
| 398 | lcov -l coverage.info # just list a short summary of the results |
onqtam | a6a866f | 2017-08-28 12:31:43 +0300 | [diff] [blame] | 399 | coveralls-lcov --repo-token=${COVERALLS_REPO_TOKEN} coverage.info # upload results |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 400 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 401 | # do not continue with other build configurations after that |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 402 | exit |
| 403 | fi |
| 404 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 405 | # static code analysis |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 406 | - | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 407 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 408 | # setup a test file "doctest.cpp" that is the header + a test case at the end |
| 409 | echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp |
| 410 | cat doctest/doctest.h >> doctest.cpp |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 411 | echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp |
| 412 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 413 | # cppcheck |
| 414 | cppcheck doctest.cpp --enable=all --suppress=unmatchedSuppression --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=functionConst --inline-suppr --platform=unix64 --inconclusive --std=posix --inconclusive -v --error-exitcode=1 --template "{file}({line}): {severity} ({id}): {message}" |
| 415 | |
| 416 | # oclint |
| 417 | oclint doctest.cpp -disable-rule=ShortVariableName -disable-rule=LongLine -disable-rule=LongMethod -disable-rule=HighNcssMethod -disable-rule=LongVariableName -disable-rule=HighCyclomaticComplexity -disable-rule=HighNPathComplexity -disable-rule=UnusedLocalVariable -disable-rule=DoubleNegative -disable-rule=MultipleUnaryOperator -disable-rule=DeepNestedBlock || exit 1 |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 418 | |
| 419 | # clang-tidy |
| 420 | cd scripts/playground |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 421 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1 |
onqtam | fdd233c | 2017-05-09 20:24:32 +0300 | [diff] [blame] | 422 | clang-tidy-4.0 -p=. *.cpp -header-filter=.* -warnings-as-errors=* -checks='*,-misc-macro-parentheses,-misc-definitions-in-headers,-misc-unused-parameters,-llvm-header-guard,-llvm-include-order,-google-readability-braces-around-statements,-google-runtime-references,-google-readability-todo,-google-build-using-namespace,-google-explicit-constructor,-cert-err58-cpp,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-special-member-functions,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-type-member-init,-cppcoreguidelines-pro-type-union-access,-clang-analyzer-security.insecureAPI.strcpy,-modernize-use-nullptr,-modernize-use-equals-default,-modernize-loop-convert,-modernize-use-auto,-readability-braces-around-statements,-readability-named-parameter,-readability-else-after-return,-readability-redundant-declaration,-readability-implicit-bool-cast' || exit 1 |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 423 | |
| 424 | # do not continue with other build configurations after that |
| 425 | exit |
| 426 | fi |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 427 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 428 | # initial run with options |
onqtam | cc35030 | 2016-06-28 14:36:28 +0300 | [diff] [blame] | 429 | - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 430 | |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 431 | # debug x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 432 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" . |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 433 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 434 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 435 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 436 | # release x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 437 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64" . |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 438 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 439 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 440 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 441 | # debug x86 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 442 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" . |
onqtam | 316fce2 | 2016-05-21 16:57:13 +0300 | [diff] [blame] | 443 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 444 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 445 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 446 | # release x86 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 447 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m32" . |
onqtam | 316fce2 | 2016-05-21 16:57:13 +0300 | [diff] [blame] | 448 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 449 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 450 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 451 | |
| 452 | # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 453 | - cmake -DDOCTEST_TEST_MODE=NORMAL . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 454 | # on separate commands because when something fails I want to see which one exactly |
onqtam | 84b19bc | 2016-08-26 12:40:31 +0300 | [diff] [blame] | 455 | # TODO: when this http://stackoverflow.com/questions/39081183 gets resolved - add these to ASAN as well: check_initialization_order=true:strict_init_order=true |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 456 | - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi |
| 457 | - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi |
| 458 | - if [[ "${HAS_ASAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi |
| 459 | - if [[ "${HAS_ASAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=address" . && make clean && make -k -j2 && ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true ctest --output-on-failure ; fi |
| 460 | - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi |
| 461 | - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi |
| 462 | - if [[ "${HAS_UBSAN_64}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m64 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi |
| 463 | - if [[ "${HAS_UBSAN_32}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -g -fno-omit-frame-pointer -m32 -fsanitize=undefined" . && make clean && make -k -j2 && UBSAN_OPTIONS=verbosity=2 ctest --output-on-failure ; fi |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 464 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 465 | # test in c++0x mode - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 466 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++0x -m64" . |
onqtam | 5cab8e9 | 2016-10-10 17:58:38 +0300 | [diff] [blame] | 467 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 468 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | 5cab8e9 | 2016-10-10 17:58:38 +0300 | [diff] [blame] | 469 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 470 | # test without rtti - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 471 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-rtti" . |
onqtam | f63c510 | 2017-02-25 20:00:52 +0200 | [diff] [blame] | 472 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 473 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | f63c510 | 2017-02-25 20:00:52 +0200 | [diff] [blame] | 474 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 475 | # test only compilation without exceptions - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 476 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -std=c++98 -m64 -fno-exceptions -DDOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS" . |
onqtam | 2d93e04 | 2017-03-17 18:57:59 +0200 | [diff] [blame] | 477 | - make clean && make -k -j2 |
| 478 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 479 | # - ccache -s |
| 480 | |
onqtam | 2dd5528 | 2016-06-13 18:05:38 +0300 | [diff] [blame] | 481 | #after_script: |
| 482 | # - cat compile_commands.json |