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 | |
| 218 | # OSX GCC 4.6 |
| 219 | - env: COMPILER=g++-4.6 |
| 220 | compiler: gcc |
| 221 | osx_image: xcode6.4 |
| 222 | os: osx |
| 223 | |
| 224 | # OSX GCC 4.7 |
| 225 | - env: COMPILER=g++-4.7 |
| 226 | compiler: gcc |
| 227 | osx_image: xcode6.4 |
| 228 | os: osx |
| 229 | |
| 230 | # OSX GCC 4.8 |
| 231 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 232 | compiler: gcc |
| 233 | osx_image: xcode6.4 |
| 234 | os: osx |
| 235 | |
| 236 | # OSX GCC 4.9 |
| 237 | - 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 |
| 238 | compiler: gcc |
| 239 | osx_image: xcode6.4 |
| 240 | os: osx |
| 241 | |
| 242 | # OSX GCC 5 |
| 243 | - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 244 | compiler: gcc |
| 245 | osx_image: xcode7.3 |
| 246 | os: osx |
| 247 | |
| 248 | # OSX GCC 6 |
| 249 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 250 | compiler: gcc |
| 251 | osx_image: xcode7.3 |
| 252 | os: osx |
| 253 | |
| 254 | # OSX GCC 7 |
| 255 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 256 | compiler: gcc |
| 257 | osx_image: xcode7.3 |
| 258 | os: osx |
| 259 | |
| 260 | # OSX LLVM-GCC |
| 261 | - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 262 | compiler: gcc |
| 263 | os: osx |
| 264 | |
| 265 | allow_failures: |
| 266 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 267 | # GCC 4.5 |
| 268 | - env: COMPILER=g++-4.5 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 269 | compiler: gcc |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 270 | |
| 271 | # Clang 3.7 |
| 272 | - env: COMPILER=clang++-3.7 |
| 273 | |
| 274 | # Clang 3.9 |
| 275 | - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 276 | |
| 277 | # Clang 5.0 |
| 278 | - env: COMPILER=clang++-5.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] | 279 | |
| 280 | # OSX GCC 4.8 |
| 281 | - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 282 | compiler: gcc |
| 283 | osx_image: xcode6.4 |
| 284 | os: osx |
| 285 | |
| 286 | # OSX GCC 6 |
| 287 | - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 288 | compiler: gcc |
| 289 | osx_image: xcode7.3 |
| 290 | os: osx |
| 291 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 292 | # OSX GCC 7 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 293 | - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 294 | compiler: gcc |
| 295 | osx_image: xcode7.3 |
| 296 | os: osx |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 297 | |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 298 | install: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 299 | - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi |
| 300 | |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 301 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 302 | # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ |
| 303 | ############################################################################ |
| 304 | |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 305 | # Make a dir for all |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 306 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" |
| 307 | - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} |
| 308 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 309 | # Install a recent CMake |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 310 | - | |
| 311 | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then |
onqtam | 8401535 | 2017-03-15 20:11:07 +0200 | [diff] [blame] | 312 | 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] | 313 | mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake |
| 314 | export PATH=${DEPS_DIR}/cmake/bin:${PATH} |
| 315 | fi |
| 316 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 317 | # Install OCLint |
| 318 | - | |
| 319 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
| 320 | OCLINT_URL="https://github.com/oclint/oclint/releases/download/v0.12/oclint-0.12-x86_64-linux-3.13.0-112-generic.tar.gz" |
| 321 | mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint |
| 322 | export PATH=${DEPS_DIR}/oclint/bin:${PATH} |
| 323 | fi |
| 324 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 325 | # Go back to ${TRAVIS_BUILD_DIR} |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 326 | - cd ${TRAVIS_BUILD_DIR} |
| 327 | |
| 328 | ############################################################################ |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 329 | # Install stuff with homebrew under OSX |
| 330 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 331 | |
onqtam | 23c6a34 | 2016-06-28 14:09:10 +0300 | [diff] [blame] | 332 | - | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 333 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 334 | brew update |
| 335 | # brew install ccache |
onqtam | 27a8c08 | 2017-04-04 17:42:41 +0300 | [diff] [blame] | 336 | # brew install valgrind |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 337 | # cmake |
| 338 | if brew list -1 | grep -q "^cmake\$"; then |
| 339 | brew outdated cmake || brew upgrade cmake |
| 340 | else |
| 341 | brew install cmake |
| 342 | fi |
| 343 | # gcc |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 344 | if [[ "${COMPILER}" = "g++-4.6" ]]; then |
| 345 | brew install gcc46 |
| 346 | fi |
| 347 | if [[ "${COMPILER}" = "g++-4.7" ]]; then |
| 348 | brew install gcc47 |
| 349 | fi |
| 350 | if [[ "${COMPILER}" = "g++-4.8" ]]; then |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 351 | brew install gcc48 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 352 | fi |
| 353 | if [[ "${COMPILER}" = "g++-4.9" ]]; then |
| 354 | brew install gcc49 |
| 355 | fi |
| 356 | if [[ "${COMPILER}" = "g++-5" ]]; then |
| 357 | brew install gcc5 |
| 358 | fi |
| 359 | if [[ "${COMPILER}" = "g++-6" ]]; then |
| 360 | brew install gcc6 |
| 361 | fi |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame] | 362 | if [[ "${COMPILER}" = "g++-7" ]]; then |
| 363 | brew install gcc7 |
| 364 | fi |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 365 | fi |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 366 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 367 | - export CXX="${COMPILER}" |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 368 | # - export CXX="ccache ${COMPILER}" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 369 | # - ccache -s |
onqtam | 7dec6aa | 2016-06-26 16:01:15 +0300 | [diff] [blame] | 370 | |
| 371 | before_script: |
| 372 | - ${CXX} --version |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 373 | |
| 374 | script: |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 375 | # coverage |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 376 | - | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 377 | if [[ "${CODE_COVERAGE}" = "true" ]]; then |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 378 | 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 |
| 379 | make -k -j2 || exit 1 |
| 380 | ctest --output-on-failure || exit 1 |
| 381 | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 382 | lcov -d . -c -o coverage.info # parse coverage data |
| 383 | lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files |
| 384 | lcov -l coverage.info # just list a short summary of the results |
onqtam | a6a866f | 2017-08-28 12:31:43 +0300 | [diff] [blame] | 385 | coveralls-lcov --repo-token=${COVERALLS_REPO_TOKEN} coverage.info # upload results |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 386 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 387 | # do not continue with other build configurations after that |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 388 | exit |
| 389 | fi |
| 390 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 391 | # static code analysis |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 392 | - | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 393 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 394 | # setup a test file "doctest.cpp" that is the header + a test case at the end |
| 395 | echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp |
| 396 | cat doctest/doctest.h >> doctest.cpp |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 397 | echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp |
| 398 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 399 | # cppcheck |
| 400 | 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}" |
| 401 | |
| 402 | # oclint |
| 403 | 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] | 404 | |
| 405 | # clang-tidy |
| 406 | cd scripts/playground |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 407 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1 |
onqtam | fdd233c | 2017-05-09 20:24:32 +0300 | [diff] [blame] | 408 | 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] | 409 | |
| 410 | # do not continue with other build configurations after that |
| 411 | exit |
| 412 | fi |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 413 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 414 | # initial run with options |
onqtam | cc35030 | 2016-06-28 14:36:28 +0300 | [diff] [blame] | 415 | - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 416 | |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 417 | # debug x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 418 | - 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] | 419 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 420 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 421 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 422 | # release x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 423 | - 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] | 424 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 425 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 426 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 427 | # debug x86 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 428 | - 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] | 429 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 430 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 431 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 432 | # release x86 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 433 | - 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] | 434 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 435 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest --output-on-failure ; fi |
| 436 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 437 | |
| 438 | # sanitizers - again 32/64 bit Debug/Release configs through address/undefined sanitizers |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 439 | - cmake -DDOCTEST_TEST_MODE=NORMAL . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 440 | # 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] | 441 | # 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] | 442 | - 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 |
| 443 | - 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 |
| 444 | - 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 |
| 445 | - 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 |
| 446 | - 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 |
| 447 | - 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 |
| 448 | - 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 |
| 449 | - 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] | 450 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 451 | # test in c++0x mode - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 452 | - 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] | 453 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 454 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | 5cab8e9 | 2016-10-10 17:58:38 +0300 | [diff] [blame] | 455 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 456 | # test without rtti - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 457 | - 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] | 458 | - make clean && make -k -j2 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 459 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest --output-on-failure |
onqtam | f63c510 | 2017-02-25 20:00:52 +0200 | [diff] [blame] | 460 | |
onqtam | 7a3ad26 | 2017-03-18 18:05:10 +0200 | [diff] [blame] | 461 | # test only compilation without exceptions - just Debug/x64 |
onqtam | 56d9170 | 2017-04-16 21:03:58 +0300 | [diff] [blame] | 462 | - 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] | 463 | - make clean && make -k -j2 |
| 464 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 465 | # - ccache -s |
| 466 | |
onqtam | 2dd5528 | 2016-06-13 18:05:38 +0300 | [diff] [blame] | 467 | #after_script: |
| 468 | # - cat compile_commands.json |