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 | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 47 | |
| 48 | compiler: clang |
| 49 | os: linux |
| 50 | |
| 51 | matrix: |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 52 | include: |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 53 | # coverage |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 54 | - env: COMPILER=g++ CODE_COVERAGE=true |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 55 | compiler: gcc |
| 56 | addons: |
| 57 | apt: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 58 | packages: ["lcov"] |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 59 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 60 | # static code analysis |
| 61 | - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 62 | addons: &clang40 |
| 63 | apt: |
| 64 | packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"] |
| 65 | sources: *apt_sources |
| 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"] |
| 73 | sources: *apt_sources |
| 74 | |
| 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"] |
| 81 | sources: *apt_sources |
| 82 | |
| 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"] |
| 89 | sources: *apt_sources |
| 90 | |
| 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"] |
| 97 | sources: *apt_sources |
| 98 | |
| 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"] |
| 105 | sources: *apt_sources |
| 106 | |
| 107 | # GCC 4.9 |
| 108 | - 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 |
| 109 | compiler: gcc |
| 110 | addons: &gcc49 |
| 111 | apt: |
| 112 | packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 113 | sources: *apt_sources |
| 114 | |
| 115 | # GCC 5 |
| 116 | - 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" |
| 117 | compiler: gcc |
| 118 | addons: &gcc5 |
| 119 | apt: |
| 120 | packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 121 | sources: *apt_sources |
| 122 | |
| 123 | # GCC 6 |
| 124 | - 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" |
| 125 | compiler: gcc |
| 126 | addons: &gcc6 |
| 127 | apt: |
| 128 | packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 129 | sources: *apt_sources |
| 130 | |
| 131 | # GCC 7 |
| 132 | - 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" |
| 133 | compiler: gcc |
| 134 | addons: &gcc7 |
| 135 | apt: |
| 136 | packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 137 | sources: *apt_sources |
| 138 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 139 | # Clang 3.5 |
| 140 | - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 141 | addons: &clang35 |
| 142 | apt: |
| 143 | packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 144 | sources: *apt_sources |
| 145 | |
| 146 | # Clang 3.6 |
| 147 | - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 148 | addons: &clang36 |
| 149 | apt: |
| 150 | packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 151 | sources: *apt_sources |
| 152 | |
| 153 | # Clang 3.7 |
| 154 | - env: COMPILER=clang++-3.7 |
| 155 | addons: &clang37 |
| 156 | apt: |
| 157 | packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 158 | sources: *apt_sources |
| 159 | |
| 160 | # Clang 3.8 |
| 161 | - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 162 | addons: &clang38 |
| 163 | apt: |
| 164 | packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 165 | sources: *apt_sources |
| 166 | |
| 167 | # Clang 3.9 |
| 168 | - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 169 | addons: &clang39 |
| 170 | apt: |
| 171 | packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 172 | sources: *apt_sources |
| 173 | |
| 174 | # Clang 4.0 |
| 175 | - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 176 | addons: &clang40 |
| 177 | apt: |
| 178 | packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 179 | sources: *apt_sources |
| 180 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 181 | # Clang 5.0 |
| 182 | - env: COMPILER=clang++-5.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 183 | addons: &clang50 |
| 184 | apt: |
| 185 | packages: ["clang-5.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 186 | sources: *apt_sources |
| 187 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 188 | # Xcode 6.4 Clang |
| 189 | - env: COMPILER=clang++ |
| 190 | osx_image: xcode6.4 |
| 191 | os: osx |
| 192 | |
| 193 | # Xcode 7.3 Clang |
| 194 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 195 | osx_image: xcode7.3 |
| 196 | os: osx |
| 197 | |
| 198 | # Xcode 8 Clang |
| 199 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 200 | osx_image: xcode8 |
| 201 | os: osx |
| 202 | |
| 203 | # Xcode 8.1 Clang |
| 204 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 205 | osx_image: xcode8.1 |
| 206 | os: osx |
| 207 | |
| 208 | # Xcode 8.2 Clang |
| 209 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 210 | osx_image: xcode8.2 |
| 211 | os: osx |
| 212 | |
| 213 | # Xcode 8.3 Clang |
| 214 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 215 | osx_image: xcode8.3 |
| 216 | os: osx |
| 217 | |
onqtam | 8603d87 | 2017-10-06 10:53:25 +0300 | [diff] [blame] | 218 | # Xcode 9 Clang |
| 219 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 220 | osx_image: xcode9 |
| 221 | os: osx |
| 222 | |
| 223 | # Xcode 9.1 Clang |
| 224 | - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 225 | osx_image: xcode9.1 |
| 226 | os: osx |
| 227 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 228 | # OSX GCC 4.6 |
| 229 | - env: COMPILER=g++-4.6 |
| 230 | compiler: gcc |
| 231 | osx_image: xcode6.4 |
| 232 | os: osx |
| 233 | |
| 234 | # OSX GCC 4.7 |
| 235 | - env: COMPILER=g++-4.7 |
| 236 | compiler: gcc |
| 237 | osx_image: xcode6.4 |
| 238 | os: osx |
| 239 | |
| 240 | # OSX GCC 4.8 |
| 241 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 242 | compiler: gcc |
| 243 | osx_image: xcode6.4 |
| 244 | os: osx |
| 245 | |
| 246 | # OSX GCC 4.9 |
| 247 | - 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 |
| 248 | compiler: gcc |
| 249 | osx_image: xcode6.4 |
| 250 | os: osx |
| 251 | |
| 252 | # OSX GCC 5 |
| 253 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 254 | compiler: gcc |
| 255 | osx_image: xcode7.3 |
| 256 | os: osx |
| 257 | |
| 258 | # OSX GCC 6 |
| 259 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 260 | compiler: gcc |
| 261 | osx_image: xcode7.3 |
| 262 | os: osx |
| 263 | |
| 264 | # OSX GCC 7 |
| 265 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 266 | compiler: gcc |
| 267 | osx_image: xcode7.3 |
| 268 | os: osx |
| 269 | |
| 270 | # OSX LLVM-GCC |
| 271 | - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 272 | compiler: gcc |
| 273 | os: osx |
| 274 | |
| 275 | allow_failures: |
| 276 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 277 | # GCC 4.5 |
| 278 | - env: COMPILER=g++-4.5 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 279 | compiler: gcc |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 280 | |
| 281 | # Clang 3.7 |
| 282 | - env: COMPILER=clang++-3.7 |
| 283 | |
| 284 | # Clang 3.9 |
| 285 | - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 286 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 287 | # OSX GCC 4.8 |
| 288 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 289 | compiler: gcc |
| 290 | osx_image: xcode6.4 |
| 291 | os: osx |
| 292 | |
| 293 | # OSX GCC 6 |
| 294 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 295 | compiler: gcc |
| 296 | osx_image: xcode7.3 |
| 297 | os: osx |
| 298 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 299 | # OSX GCC 7 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 300 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 301 | compiler: gcc |
| 302 | osx_image: xcode7.3 |
| 303 | os: osx |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 304 | |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 305 | install: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 306 | - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi |
| 307 | |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 308 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 309 | # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ |
| 310 | ############################################################################ |
| 311 | |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 312 | # Make a dir for all |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 313 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" |
| 314 | - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} |
| 315 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 316 | # Install a recent CMake |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 317 | - | |
| 318 | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then |
onqtam | 8401535 | 2017-03-15 20:11:07 +0200 | [diff] [blame] | 319 | 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] | 320 | mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake |
| 321 | export PATH=${DEPS_DIR}/cmake/bin:${PATH} |
| 322 | fi |
| 323 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 324 | # Install OCLint |
| 325 | - | |
| 326 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
| 327 | OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz" |
| 328 | mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint |
| 329 | export PATH=${DEPS_DIR}/oclint/bin:${PATH} |
| 330 | fi |
| 331 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 332 | # Go back to ${TRAVIS_BUILD_DIR} |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 333 | - cd ${TRAVIS_BUILD_DIR} |
| 334 | |
| 335 | ############################################################################ |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 336 | # Install stuff with homebrew under OSX |
| 337 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 338 | |
onqtam | 23c6a34 | 2016-06-28 14:09:10 +0300 | [diff] [blame] | 339 | - | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 340 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 341 | brew update |
| 342 | # brew install ccache |
onqtam | 27a8c08 | 2017-04-04 17:42:41 +0300 | [diff] [blame] | 343 | # brew install valgrind |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 344 | # cmake |
| 345 | if brew list -1 | grep -q "^cmake\$"; then |
| 346 | brew outdated cmake || brew upgrade cmake |
| 347 | else |
| 348 | brew install cmake |
| 349 | fi |
| 350 | # gcc |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 351 | if [[ "${COMPILER}" = "g++-4.6" ]]; then |
| 352 | brew install gcc46 |
| 353 | fi |
| 354 | if [[ "${COMPILER}" = "g++-4.7" ]]; then |
| 355 | brew install gcc47 |
| 356 | fi |
| 357 | if [[ "${COMPILER}" = "g++-4.8" ]]; then |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 358 | brew install gcc48 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 359 | fi |
| 360 | if [[ "${COMPILER}" = "g++-4.9" ]]; then |
| 361 | brew install gcc49 |
| 362 | fi |
| 363 | if [[ "${COMPILER}" = "g++-5" ]]; then |
| 364 | brew install gcc5 |
| 365 | fi |
| 366 | if [[ "${COMPILER}" = "g++-6" ]]; then |
| 367 | brew install gcc6 |
| 368 | fi |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame] | 369 | if [[ "${COMPILER}" = "g++-7" ]]; then |
| 370 | brew install gcc7 |
| 371 | fi |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 372 | fi |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 373 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 374 | - export CXX="${COMPILER}" |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 375 | # - export CXX="ccache ${COMPILER}" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 376 | # - ccache -s |
onqtam | 7dec6aa | 2016-06-26 16:01:15 +0300 | [diff] [blame] | 377 | |
| 378 | before_script: |
| 379 | - ${CXX} --version |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 380 | |
| 381 | script: |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 382 | # coverage |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 383 | - | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 384 | if [[ "${CODE_COVERAGE}" = "true" ]]; then |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 385 | 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 |
| 386 | make -k -j2 || exit 1 |
| 387 | ctest --output-on-failure || exit 1 |
| 388 | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 389 | lcov -d . -c -o coverage.info # parse coverage data |
| 390 | lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files |
| 391 | lcov -l coverage.info # just list a short summary of the results |
onqtam | a6a866f | 2017-08-28 12:31:43 +0300 | [diff] [blame] | 392 | coveralls-lcov --repo-token=${COVERALLS_REPO_TOKEN} coverage.info # upload results |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 393 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 394 | # do not continue with other build configurations after that |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 395 | exit |
| 396 | fi |
| 397 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 398 | # static code analysis |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 399 | - | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 400 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 401 | # setup a test file "doctest.cpp" that is the header + a test case at the end |
| 402 | echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp |
| 403 | cat doctest/doctest.h >> doctest.cpp |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 404 | echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp |
| 405 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 406 | # cppcheck |
| 407 | 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}" |
| 408 | |
| 409 | # oclint |
| 410 | 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] | 411 | |
| 412 | # clang-tidy |
| 413 | cd scripts/playground |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 414 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1 |
onqtam | fdd233c | 2017-05-09 20:24:32 +0300 | [diff] [blame] | 415 | 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] | 416 | |
| 417 | # do not continue with other build configurations after that |
| 418 | exit |
| 419 | fi |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 420 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 421 | # initial run with options |
onqtam | cc35030 | 2016-06-28 14:36:28 +0300 | [diff] [blame] | 422 | - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 423 | |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 424 | # debug x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 425 | - 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] | 426 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 427 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 428 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 429 | # release x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 430 | - 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] | 431 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 432 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 433 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 434 | # debug x86 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 435 | - 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] | 436 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 437 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 438 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 439 | # release x86 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 440 | - 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] | 441 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 442 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 443 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 444 | |
| 445 | # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 446 | - cmake -DDOCTEST_TEST_MODE=NORMAL . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 447 | # 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] | 448 | # 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] | 449 | - 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 |
| 450 | - 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 |
| 451 | - 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 |
| 452 | - 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 |
| 453 | - 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 |
| 454 | - 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 |
| 455 | - 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 |
| 456 | - 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] | 457 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 458 | # test in c++0x mode - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 459 | - 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] | 460 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 461 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | 5cab8e9 | 2016-10-10 17:58:38 +0300 | [diff] [blame] | 462 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 463 | # test without rtti - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 464 | - 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] | 465 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 466 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | f63c510 | 2017-02-25 20:00:52 +0200 | [diff] [blame] | 467 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 468 | # test only compilation without exceptions - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 469 | - 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] | 470 | - make clean && make -k -j2 |
| 471 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 472 | # - ccache -s |
| 473 | |
onqtam | 2dd5528 | 2016-06-13 18:05:38 +0300 | [diff] [blame] | 474 | #after_script: |
| 475 | # - cat compile_commands.json |