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