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 | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 3 | sudo: false |
| 4 | language: c++ |
| 5 | |
| 6 | notifications: |
onqtam | f516977 | 2016-09-09 18:33:13 +0300 | [diff] [blame] | 7 | email: false |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 8 | # gitter |
| 9 | webhooks: |
| 10 | urls: https://webhooks.gitter.im/e/10941dd1c67e5e967706 |
| 11 | on_success: change |
| 12 | on_failure: always |
| 13 | git: |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 14 | depth: 500 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 15 | |
| 16 | # both apt and ccache make the builds slower... |
| 17 | #cache: |
| 18 | # - apt |
| 19 | # - ccache |
| 20 | |
| 21 | env: |
| 22 | global: |
| 23 | # - USE_CCACHE=1 |
| 24 | # - CCACHE_SLOPPINESS=pch_defines,time_macros |
| 25 | # - CCACHE_COMPRESS=1 |
| 26 | # - CCACHE_MAXSIZE=200M |
| 27 | # - CCACHE_CPP2=1 |
| 28 | - CMAKE_OPTIONS_GLOBAL="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" |
| 29 | # Workaround for https://github.com/travis-ci/travis-ci/issues/4681 |
| 30 | # "Defining the build matrix only with matrix.include leads to an additional, unwanted job" |
| 31 | matrix: |
| 32 | - TRAVIS_EMPTY_JOB_WORKAROUND=true |
| 33 | |
| 34 | addons: |
| 35 | coverity_scan: |
| 36 | # COVERITY_SCAN_TOKEN added as env var in travis project |
| 37 | project: |
| 38 | name: onqtam/doctest |
| 39 | notification_email: vik.kirilov@gmail.com |
| 40 | build_command_prepend: cd examples/hello_world && cmake . |
| 41 | build_command: make |
| 42 | branch_pattern: coverity_scan |
| 43 | # these apt sources will be referenced later (by using *name) |
| 44 | apt: |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 45 | sources: &apt_sources |
| 46 | - ubuntu-toolchain-r-test |
onqtam | 7e775f9 | 2016-11-15 02:41:10 +0200 | [diff] [blame] | 47 | - llvm-toolchain-precise |
onqtam | b382bd3 | 2016-08-01 20:53:56 +0300 | [diff] [blame] | 48 | - llvm-toolchain-precise-3.5 |
| 49 | - llvm-toolchain-precise-3.6 |
| 50 | - llvm-toolchain-precise-3.7 |
| 51 | - llvm-toolchain-precise-3.8 |
onqtam | fd62aa0 | 2016-11-15 03:00:44 +0200 | [diff] [blame] | 52 | - llvm-toolchain-precise-3.9 |
onqtam | 3bf83c4 | 2017-04-23 15:30:23 +0300 | [diff] [blame] | 53 | - llvm-toolchain-trusty |
| 54 | - llvm-toolchain-trusty-4.0 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 55 | |
| 56 | compiler: clang |
| 57 | os: linux |
| 58 | |
| 59 | matrix: |
| 60 | exclude: |
| 61 | - env: TRAVIS_EMPTY_JOB_WORKAROUND=true |
| 62 | |
| 63 | include: |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 64 | # coverage |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 65 | - env: COMPILER=g++ CODE_COVERAGE=true |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 66 | compiler: gcc |
| 67 | addons: |
| 68 | apt: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 69 | packages: ["lcov"] |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 70 | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 71 | # # static code analysis |
| 72 | # - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true |
| 73 | # dist: trusty |
| 74 | # addons: &clang40 |
| 75 | # apt: |
| 76 | # packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"] |
| 77 | # sources: *apt_sources |
| 78 | # |
| 79 | # # GCC 4.4 |
| 80 | # - env: COMPILER=g++-4.4 |
| 81 | # compiler: gcc |
| 82 | # addons: &gcc44 |
| 83 | # apt: |
| 84 | # packages: ["g++-4.4", "valgrind", "g++-4.4-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 85 | # sources: *apt_sources |
| 86 | # |
| 87 | # # GCC 4.5 |
| 88 | # - env: COMPILER=g++-4.5 |
| 89 | # compiler: gcc |
| 90 | # addons: &gcc45 |
| 91 | # apt: |
| 92 | # packages: ["g++-4.5", "valgrind", "g++-4.5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 93 | # sources: *apt_sources |
| 94 | # |
| 95 | # # GCC 4.6 |
| 96 | # - env: COMPILER=g++-4.6 |
| 97 | # compiler: gcc |
| 98 | # addons: &gcc46 |
| 99 | # apt: |
| 100 | # packages: [ "valgrind", "g++-4.6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 101 | # sources: *apt_sources |
| 102 | # |
| 103 | # # GCC 4.7 |
| 104 | # - env: COMPILER=g++-4.7 |
| 105 | # compiler: gcc |
| 106 | # addons: &gcc47 |
| 107 | # apt: |
| 108 | # packages: ["g++-4.7", "valgrind", "g++-4.7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 109 | # sources: *apt_sources |
| 110 | # |
| 111 | # # GCC 4.8 |
| 112 | # - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 113 | # compiler: gcc |
| 114 | # addons: &gcc48 |
| 115 | # apt: |
| 116 | # packages: ["g++-4.8", "valgrind", "g++-4.8-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 117 | # sources: *apt_sources |
| 118 | # |
| 119 | # # GCC 4.9 |
| 120 | # - 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 |
| 121 | # compiler: gcc |
| 122 | # addons: &gcc49 |
| 123 | # apt: |
| 124 | # packages: ["g++-4.9", "valgrind", "g++-4.9-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 125 | # sources: *apt_sources |
| 126 | # |
| 127 | # # GCC 5 |
| 128 | # - 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" |
| 129 | # compiler: gcc |
| 130 | # addons: &gcc5 |
| 131 | # apt: |
| 132 | # packages: ["g++-5", "valgrind", "g++-5-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 133 | # sources: *apt_sources |
| 134 | # |
| 135 | # # GCC 6 |
| 136 | # - 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" |
| 137 | # compiler: gcc |
| 138 | # addons: &gcc6 |
| 139 | # apt: |
| 140 | # packages: ["g++-6", "valgrind", "g++-6-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 141 | # sources: *apt_sources |
| 142 | # |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame^] | 143 | # # GCC 7 |
| 144 | # - 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" |
| 145 | # compiler: gcc |
| 146 | # addons: &gcc7 |
| 147 | # apt: |
| 148 | # packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 149 | # sources: *apt_sources |
| 150 | # |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 151 | # # Clang 3.4 |
| 152 | # - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 153 | # addons: &clang |
| 154 | # apt: |
| 155 | # packages: [ "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 156 | # sources: *apt_sources |
| 157 | # |
| 158 | # # Clang 3.5 |
| 159 | # - env: COMPILER=clang++-3.5 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 160 | # addons: &clang35 |
| 161 | # apt: |
| 162 | # packages: ["clang-3.5", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 163 | # sources: *apt_sources |
| 164 | # |
| 165 | # # Clang 3.6 |
| 166 | # - env: COMPILER=clang++-3.6 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 167 | # addons: &clang36 |
| 168 | # apt: |
| 169 | # packages: ["clang-3.6", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 170 | # sources: *apt_sources |
| 171 | # |
| 172 | # # Clang 3.7 |
| 173 | # - env: COMPILER=clang++-3.7 |
| 174 | # addons: &clang37 |
| 175 | # apt: |
| 176 | # packages: ["clang-3.7", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 177 | # sources: *apt_sources |
| 178 | # |
| 179 | # # Clang 3.8 |
| 180 | # - env: COMPILER=clang++-3.8 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 181 | # addons: &clang38 |
| 182 | # apt: |
| 183 | # packages: ["clang-3.8", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 184 | # sources: *apt_sources |
| 185 | # |
| 186 | # # Clang 3.9 |
| 187 | # - env: COMPILER=clang++-3.9 HAS_ASAN_64=true HAS_UBSAN_64=true |
| 188 | # addons: &clang39 |
| 189 | # apt: |
| 190 | # packages: ["clang-3.9", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 191 | # sources: *apt_sources |
| 192 | # |
| 193 | # # Clang 4.0 |
| 194 | # - env: COMPILER=clang++-4.0 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 195 | # dist: trusty |
| 196 | # addons: &clang40 |
| 197 | # apt: |
| 198 | # packages: ["clang-4.0", "valgrind", "g++-multilib", "libc6-dbg", "libc6-dbg:i386", "g++-6"] |
| 199 | # sources: *apt_sources |
| 200 | # |
| 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 | # |
| 216 | # # Xcode 8.1 Clang |
| 217 | # - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 218 | # osx_image: xcode8.1 |
| 219 | # os: osx |
| 220 | # |
| 221 | # # Xcode 8.2 Clang |
| 222 | # - env: COMPILER=clang++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 223 | # osx_image: xcode8.2 |
| 224 | # os: osx |
| 225 | # |
| 226 | # # Xcode 8.3 Clang |
| 227 | # - env: COMPILER=clang++ HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 228 | # osx_image: xcode8.3 |
| 229 | # os: osx |
| 230 | # |
| 231 | # # OSX GCC 4.6 |
| 232 | # - env: COMPILER=g++-4.6 |
| 233 | # compiler: gcc |
| 234 | # osx_image: xcode6.4 |
| 235 | # os: osx |
| 236 | # |
| 237 | # # OSX GCC 4.7 |
| 238 | # - env: COMPILER=g++-4.7 |
| 239 | # compiler: gcc |
| 240 | # osx_image: xcode6.4 |
| 241 | # os: osx |
| 242 | # |
| 243 | # # OSX GCC 4.8 |
| 244 | # - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 245 | # compiler: gcc |
| 246 | # osx_image: xcode6.4 |
| 247 | # os: osx |
| 248 | # |
| 249 | # # OSX GCC 4.9 |
| 250 | # - 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 |
| 251 | # compiler: gcc |
| 252 | # osx_image: xcode6.4 |
| 253 | # os: osx |
| 254 | # |
| 255 | # # OSX GCC 5 |
| 256 | # - env: COMPILER=g++-5 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 257 | # compiler: gcc |
| 258 | # osx_image: xcode7.3 |
| 259 | # os: osx |
| 260 | # |
| 261 | # # OSX GCC 6 |
| 262 | # - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 263 | # compiler: gcc |
| 264 | # osx_image: xcode7.3 |
| 265 | # os: osx |
| 266 | # |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame^] | 267 | # # OSX GCC 7 |
| 268 | # - env: COMPILER=g++-7 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 269 | # compiler: gcc |
| 270 | # osx_image: xcode7.3 |
| 271 | # os: osx |
| 272 | # |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 273 | # # OSX LLVM-GCC |
| 274 | # - env: COMPILER=g++ HAS_ASAN_32=true HAS_ASAN_64=true |
| 275 | # compiler: gcc |
| 276 | # os: osx |
| 277 | # |
| 278 | # allow_failures: |
| 279 | # |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame^] | 280 | # # GCC 7 |
| 281 | # - 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" |
| 282 | # compiler: gcc |
| 283 | # addons: &gcc7 |
| 284 | # apt: |
| 285 | # packages: ["g++-7", "valgrind", "g++-7-multilib", "libc6-dbg", "libc6-dbg:i386"] |
| 286 | # sources: *apt_sources |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 287 | # |
| 288 | # # OSX GCC 4.8 |
| 289 | # - env: COMPILER=g++-4.8 HAS_ASAN_32=true HAS_ASAN_64=true |
| 290 | # compiler: gcc |
| 291 | # osx_image: xcode6.4 |
| 292 | # os: osx |
| 293 | # |
| 294 | # # OSX GCC 6 |
| 295 | # - env: COMPILER=g++-6 HAS_ASAN_32=true HAS_UBSAN_32=true HAS_ASAN_64=true HAS_UBSAN_64=true |
| 296 | # compiler: gcc |
| 297 | # osx_image: xcode7.3 |
| 298 | # os: osx |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame^] | 299 | # |
| 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 | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 305 | before_install: |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 306 | - git submodule update --init --recursive |
| 307 | |
| 308 | install: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 309 | - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi |
| 310 | |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 311 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 312 | # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ |
| 313 | ############################################################################ |
| 314 | |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 315 | # Make a dir for all |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 316 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" |
| 317 | - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} |
| 318 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 319 | # Install a recent CMake |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 320 | - | |
| 321 | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then |
onqtam | 8401535 | 2017-03-15 20:11:07 +0200 | [diff] [blame] | 322 | 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] | 323 | mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake |
| 324 | export PATH=${DEPS_DIR}/cmake/bin:${PATH} |
| 325 | fi |
| 326 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 327 | # Go back to ${TRAVIS_BUILD_DIR} |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 328 | - cd ${TRAVIS_BUILD_DIR} |
| 329 | |
| 330 | ############################################################################ |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 331 | # Install stuff with homebrew under OSX |
| 332 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 333 | |
onqtam | 23c6a34 | 2016-06-28 14:09:10 +0300 | [diff] [blame] | 334 | - | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 335 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 336 | brew update |
| 337 | # brew install ccache |
onqtam | 27a8c08 | 2017-04-04 17:42:41 +0300 | [diff] [blame] | 338 | # brew install valgrind |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 339 | # cmake |
| 340 | if brew list -1 | grep -q "^cmake\$"; then |
| 341 | brew outdated cmake || brew upgrade cmake |
| 342 | else |
| 343 | brew install cmake |
| 344 | fi |
| 345 | # gcc |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 346 | if [[ "${COMPILER}" = "g++-4.6" ]]; then |
| 347 | brew install gcc46 |
| 348 | fi |
| 349 | if [[ "${COMPILER}" = "g++-4.7" ]]; then |
| 350 | brew install gcc47 |
| 351 | fi |
| 352 | if [[ "${COMPILER}" = "g++-4.8" ]]; then |
onqtam | b1a3de8 | 2016-10-10 22:22:00 +0300 | [diff] [blame] | 353 | brew install gcc48 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 354 | fi |
| 355 | if [[ "${COMPILER}" = "g++-4.9" ]]; then |
| 356 | brew install gcc49 |
| 357 | fi |
| 358 | if [[ "${COMPILER}" = "g++-5" ]]; then |
| 359 | brew install gcc5 |
| 360 | fi |
| 361 | if [[ "${COMPILER}" = "g++-6" ]]; then |
| 362 | brew install gcc6 |
| 363 | fi |
onqtam | aab98c5 | 2017-05-02 19:48:42 +0300 | [diff] [blame^] | 364 | if [[ "${COMPILER}" = "g++-7" ]]; then |
| 365 | brew install gcc7 |
| 366 | fi |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 367 | fi |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 368 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 369 | - export CXX="${COMPILER}" |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 370 | # - export CXX="ccache ${COMPILER}" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 371 | # - ccache -s |
onqtam | 7dec6aa | 2016-06-26 16:01:15 +0300 | [diff] [blame] | 372 | |
| 373 | before_script: |
| 374 | - ${CXX} --version |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 375 | |
| 376 | script: |
| 377 | # coverage - do not continue with other build configurations after that |
| 378 | - | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 379 | if [[ "${CODE_COVERAGE}" = "true" ]]; then |
onqtam | 7630535 | 2017-05-01 20:25:09 +0300 | [diff] [blame] | 380 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -std=c++98" -DCMAKE_BUILD_TYPE=Debug . |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 381 | make -k -j2 |
| 382 | ctest --output-on-failure |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 383 | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 384 | lcov -d . -c -o coverage.info # parse coverage data |
| 385 | lcov -r coverage.info "/usr*" "$(readlink -f examples)/*" -o coverage.info # remove data for system headers and .cpp files |
| 386 | lcov -l coverage.info # just list a short summary of the results |
| 387 | coveralls-lcov --repo-token ${COVERALLS_REPO_TOKEN} coverage.info # upload results |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 388 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 389 | exit |
| 390 | fi |
| 391 | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 392 | # static code analysis - do not continue with other build configurations after that |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 393 | - | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 394 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
| 395 | # cppcheck |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 396 | cp doctest/doctest.h doctest.cpp |
| 397 | echo -e "TEST_CASE(\"\") {" >> doctest.cpp |
| 398 | echo -e " int a;" >> doctest.cpp |
| 399 | echo -e " SUBCASE(\"ouch\") a = 5;" >> doctest.cpp |
| 400 | echo -e " CAPTURE(a);" >> doctest.cpp |
| 401 | echo -e " CHECK(a == 6);" >> doctest.cpp |
| 402 | echo -e "}" >> doctest.cpp |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 403 | |
onqtam | f1477ab | 2017-04-27 22:24:28 +0300 | [diff] [blame] | 404 | 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}" -DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 405 | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 406 | # clang-tidy |
| 407 | cd scripts/playground |
| 408 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . |
| 409 | 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,-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' |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 410 | |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 411 | exit |
| 412 | fi |
| 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 |