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 | 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" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 29 | |
| 30 | addons: |
| 31 | coverity_scan: |
| 32 | # COVERITY_SCAN_TOKEN added as env var in travis project |
| 33 | project: |
| 34 | name: onqtam/doctest |
| 35 | notification_email: vik.kirilov@gmail.com |
onqtam | 92a9ce1 | 2017-05-29 23:56:22 +0300 | [diff] [blame] | 36 | build_command: clang++ scripts/hello_world.cpp -I doctest |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 37 | branch_pattern: coverity_scan |
| 38 | # these apt sources will be referenced later (by using *name) |
| 39 | apt: |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 40 | sources: &apt_sources |
| 41 | - ubuntu-toolchain-r-test |
onqtam | 3bf83c4 | 2017-04-23 15:30:23 +0300 | [diff] [blame] | 42 | - llvm-toolchain-trusty |
onqtam | 1cb49f8 | 2018-06-01 11:44:43 +0300 | [diff] [blame] | 43 | - llvm-toolchain-precise-3.7 |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 44 | - llvm-toolchain-trusty-3.9 |
onqtam | 3bf83c4 | 2017-04-23 15:30:23 +0300 | [diff] [blame] | 45 | - llvm-toolchain-trusty-4.0 |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 46 | - llvm-toolchain-trusty-5.0 |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 47 | - llvm-toolchain-trusty-6.0 |
AMS21 | 1527482 | 2018-11-12 08:55:30 +0100 | [diff] [blame] | 48 | - llvm-toolchain-trusty-7 |
onqtam | 0875406 | 2019-03-20 18:53:33 +0200 | [diff] [blame] | 49 | - llvm-toolchain-trusty-8 |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 50 | |
| 51 | compiler: clang |
| 52 | os: linux |
| 53 | |
| 54 | matrix: |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 55 | include: |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 56 | # coverage |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 57 | - env: COMPILER=g++ CODE_COVERAGE=true |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 58 | compiler: gcc |
| 59 | addons: |
| 60 | apt: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 61 | packages: ["lcov"] |
onqtam | d1737e4 | 2016-08-01 19:05:07 +0300 | [diff] [blame] | 62 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 63 | # static code analysis |
onqtam | 8c3352f | 2018-05-09 12:09:32 +0300 | [diff] [blame] | 64 | - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true |
| 65 | addons: &static_analysis |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 66 | apt: |
onqtam | 8c3352f | 2018-05-09 12:09:32 +0300 | [diff] [blame] | 67 | packages: ["clang-4.0", "clang-tidy-4.0", "cppcheck"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 68 | sources: *apt_sources |
| 69 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 70 | # GCC 4.8 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 71 | - env: COMPILER=g++-4.8 HAS_ASAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" # TSAN broken for some time - seg faults |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 72 | compiler: gcc |
| 73 | addons: &gcc48 |
| 74 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 75 | packages: ["g++-4.8", "valgrind", "libc6-dbg", "linux-libc-dev"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 76 | sources: *apt_sources |
| 77 | |
| 78 | # GCC 4.9 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 79 | - env: COMPILER=g++-4.9 HAS_ASAN=true HAS_UBSAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" # TSAN broken for some time - seg faults |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 80 | compiler: gcc |
| 81 | addons: &gcc49 |
| 82 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 83 | packages: ["g++-4.9", "valgrind", "libc6-dbg", "linux-libc-dev"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 84 | sources: *apt_sources |
| 85 | |
| 86 | # GCC 5 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 87 | - env: COMPILER=g++-5 HAS_ASAN=true HAS_UBSAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" # TSAN broken for some time - seg faults |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 88 | compiler: gcc |
| 89 | addons: &gcc5 |
| 90 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 91 | packages: ["g++-5", "valgrind", "libc6-dbg", "linux-libc-dev"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 92 | sources: *apt_sources |
| 93 | |
| 94 | # GCC 6 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 95 | - env: COMPILER=g++-6 HAS_ASAN=true HAS_UBSAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" # TSAN broken for some time - seg faults |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 96 | compiler: gcc |
| 97 | addons: &gcc6 |
| 98 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 99 | packages: ["g++-6", "valgrind", "libc6-dbg", "linux-libc-dev"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 100 | sources: *apt_sources |
| 101 | |
| 102 | # GCC 7 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 103 | - env: COMPILER=g++-7 HAS_ASAN=true HAS_UBSAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" # TSAN broken for some time - seg faults |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 104 | compiler: gcc |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame] | 105 | 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] | 106 | addons: &gcc7 |
| 107 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 108 | packages: ["g++-7", "valgrind", "libc6-dbg", "linux-libc-dev"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 109 | sources: *apt_sources |
| 110 | |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 111 | # GCC 8 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 112 | - env: COMPILER=g++-8 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 113 | compiler: gcc |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame] | 114 | 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] | 115 | addons: &gcc8 |
| 116 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 117 | packages: ["g++-8", "valgrind", "libc6-dbg", "linux-libc-dev"] |
onqtam | e5f8b67 | 2018-05-03 16:02:32 +0300 | [diff] [blame] | 118 | sources: *apt_sources |
| 119 | |
onqtam | 0df6ead | 2019-05-06 11:18:28 +0300 | [diff] [blame] | 120 | # GCC 9 |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 121 | - env: COMPILER=g++-9 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true SANITIZER_CXX_FLAGS="-fuse-ld=gold -static-libasan" TSAN_CXX_FLAGS="-ltsan" |
onqtam | 0df6ead | 2019-05-06 11:18:28 +0300 | [diff] [blame] | 122 | compiler: gcc |
| 123 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
| 124 | addons: &gcc9 |
| 125 | apt: |
| 126 | packages: ["g++-9", "valgrind", "libc6-dbg", "linux-libc-dev"] |
| 127 | sources: *apt_sources |
| 128 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 129 | # Clang 3.5 |
onqtam | 3c549c9 | 2018-08-19 23:14:34 +0300 | [diff] [blame] | 130 | - env: COMPILER=clang++-3.5 HAS_ASAN=true HAS_UBSAN=true # no HAS_TSAN - see errors: https://travis-ci.org/onqtam/doctest/builds/417926743 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 131 | addons: &clang35 |
| 132 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 133 | packages: ["clang-3.5", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 134 | sources: *apt_sources |
| 135 | |
| 136 | # Clang 3.6 |
onqtam | 3c549c9 | 2018-08-19 23:14:34 +0300 | [diff] [blame] | 137 | - env: COMPILER=clang++-3.6 HAS_ASAN=true HAS_UBSAN=true # no HAS_TSAN - see errors: https://travis-ci.org/onqtam/doctest/builds/417926743 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 138 | addons: &clang36 |
| 139 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 140 | packages: ["clang-3.6", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 141 | sources: *apt_sources |
| 142 | |
| 143 | # Clang 3.7 |
| 144 | - env: COMPILER=clang++-3.7 |
| 145 | addons: &clang37 |
| 146 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 147 | packages: ["clang-3.7", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 148 | sources: *apt_sources |
| 149 | |
| 150 | # Clang 3.8 |
onqtam | 3c549c9 | 2018-08-19 23:14:34 +0300 | [diff] [blame] | 151 | - env: COMPILER=clang++-3.8 HAS_ASAN=true HAS_UBSAN=true # no HAS_TSAN - see errors: https://travis-ci.org/onqtam/doctest/builds/417926743 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 152 | addons: &clang38 |
| 153 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 154 | packages: ["clang-3.8", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 155 | sources: *apt_sources |
| 156 | |
| 157 | # Clang 3.9 |
onqtam | d9d22d7 | 2018-08-19 19:28:03 +0300 | [diff] [blame] | 158 | - env: COMPILER=clang++-3.9 # no HAS_ASAN/HAS_UBSAN - see errors: https://travis-ci.org/onqtam/doctest/jobs/386263910 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 159 | addons: &clang39 |
| 160 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 161 | packages: ["clang-3.9", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 162 | sources: *apt_sources |
| 163 | |
| 164 | # Clang 4.0 |
onqtam | d9d22d7 | 2018-08-19 19:28:03 +0300 | [diff] [blame] | 165 | - env: COMPILER=clang++-4.0 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame] | 166 | 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] | 167 | addons: &clang40 |
| 168 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 169 | packages: ["clang-4.0", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 170 | sources: *apt_sources |
| 171 | |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 172 | # Clang 5.0 |
onqtam | d9d22d7 | 2018-08-19 19:28:03 +0300 | [diff] [blame] | 173 | - env: COMPILER=clang++-5.0 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
onqtam | 051def3 | 2018-05-09 11:30:10 +0300 | [diff] [blame] | 174 | 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] | 175 | addons: &clang50 |
| 176 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 177 | packages: ["clang-5.0", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | 803bb8f | 2017-09-05 13:00:24 +0300 | [diff] [blame] | 178 | sources: *apt_sources |
| 179 | |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 180 | # Clang 6.0 |
onqtam | d9d22d7 | 2018-08-19 19:28:03 +0300 | [diff] [blame] | 181 | - env: COMPILER=clang++-6.0 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 182 | 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] | 183 | addons: &clang60 |
| 184 | apt: |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 185 | packages: ["clang-6.0", "valgrind", "libc6-dbg", "g++-6"] |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 186 | sources: *apt_sources |
onqtam | 0875406 | 2019-03-20 18:53:33 +0200 | [diff] [blame] | 187 | |
AMS21 | 1527482 | 2018-11-12 08:55:30 +0100 | [diff] [blame] | 188 | # Clang 7 |
| 189 | - env: COMPILER=clang++-7 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
| 190 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
| 191 | addons: &clang7 |
| 192 | apt: |
| 193 | packages: ["clang-7", "valgrind", "libc6-dbg", "g++-6"] |
| 194 | sources: *apt_sources |
onqtam | cb279b2 | 2018-03-09 01:31:09 +0700 | [diff] [blame] | 195 | |
onqtam | 0875406 | 2019-03-20 18:53:33 +0200 | [diff] [blame] | 196 | # Clang 8 |
| 197 | - env: COMPILER=clang++-8 HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
| 198 | sudo: required # see this issue for more details: https://github.com/travis-ci/travis-ci/issues/9033 |
| 199 | addons: &clang8 |
| 200 | apt: |
| 201 | packages: ["clang-8", "valgrind", "libc6-dbg", "g++-6"] |
| 202 | sources: *apt_sources |
| 203 | |
onqtam | eb89a02 | 2019-01-14 00:16:11 +0200 | [diff] [blame] | 204 | # Xcode 6.4 Clang |
onqtam | b031dd0 | 2019-01-15 20:25:19 +0200 | [diff] [blame] | 205 | - env: COMPILER=clang++ CMAKE_OPTIONS="-DDOCTEST_THREAD_LOCAL=" |
onqtam | eb89a02 | 2019-01-14 00:16:11 +0200 | [diff] [blame] | 206 | osx_image: xcode6.4 |
| 207 | os: osx |
| 208 | |
| 209 | # Xcode 7.3 Clang |
onqtam | b031dd0 | 2019-01-15 20:25:19 +0200 | [diff] [blame] | 210 | - env: COMPILER=clang++ HAS_ASAN=true CMAKE_OPTIONS="-DDOCTEST_THREAD_LOCAL=" |
onqtam | eb89a02 | 2019-01-14 00:16:11 +0200 | [diff] [blame] | 211 | osx_image: xcode7.3 |
| 212 | os: osx |
| 213 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 214 | # Xcode 8 Clang |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 215 | - env: COMPILER=clang++ HAS_TSAN=true # no HAS_ASAN - errors since using thread_local even in single-threaded cases - see errors: https://travis-ci.org/onqtam/doctest/builds/417181981 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 216 | osx_image: xcode8 |
| 217 | os: osx |
| 218 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 219 | # Xcode 8.3 Clang |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 220 | - env: COMPILER=clang++ HAS_UBSAN=true HAS_TSAN=true # no HAS_ASAN - errors since using thread_local even in single-threaded cases - see errors: https://travis-ci.org/onqtam/doctest/builds/417181981 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 221 | osx_image: xcode8.3 |
| 222 | os: osx |
| 223 | |
onqtam | 50cbb80 | 2017-12-09 17:17:39 +0200 | [diff] [blame] | 224 | # Xcode 9.2 Clang |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 225 | - env: COMPILER=clang++ HAS_UBSAN=true HAS_TSAN=true # no HAS_ASAN - errors since using thread_local even in single-threaded cases - see errors: https://travis-ci.org/onqtam/doctest/builds/417181981 |
onqtam | 50cbb80 | 2017-12-09 17:17:39 +0200 | [diff] [blame] | 226 | osx_image: xcode9.2 |
| 227 | os: osx |
| 228 | |
onqtam | 7c606ea | 2018-08-15 10:16:21 +0300 | [diff] [blame] | 229 | # Xcode 9.4 Clang |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 230 | - env: COMPILER=clang++ HAS_UBSAN=true HAS_TSAN=true # no HAS_ASAN - errors since using thread_local even in single-threaded cases - see errors: https://travis-ci.org/onqtam/doctest/builds/417181981 |
onqtam | 7c606ea | 2018-08-15 10:16:21 +0300 | [diff] [blame] | 231 | osx_image: xcode9.4 |
onqtam | 3a3bc20 | 2018-04-10 13:54:28 +0300 | [diff] [blame] | 232 | os: osx |
| 233 | |
onqtam | 09fd51d | 2018-08-16 19:55:21 +0300 | [diff] [blame] | 234 | # Xcode 10.0 Clang |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 235 | - env: COMPILER=clang++ HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
onqtam | 09fd51d | 2018-08-16 19:55:21 +0300 | [diff] [blame] | 236 | osx_image: xcode10 |
| 237 | os: osx |
| 238 | |
onqtam | 5a18b49 | 2019-03-02 16:04:25 +0200 | [diff] [blame] | 239 | # Xcode 10.2 Clang |
| 240 | - env: COMPILER=clang++ HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
| 241 | osx_image: xcode10.2 |
| 242 | os: osx |
| 243 | |
onqtam | accd1e4 | 2019-10-10 22:02:11 +0300 | [diff] [blame] | 244 | # Xcode 11.2 Clang |
| 245 | - env: COMPILER=clang++ HAS_ASAN=true HAS_UBSAN=true HAS_TSAN=true |
| 246 | osx_image: xcode11.2 |
| 247 | os: osx |
| 248 | |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 249 | # OSX LLVM-GCC |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 250 | - env: COMPILER=g++ HAS_ASAN=true HAS_TSAN=true |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 251 | compiler: gcc |
onqtam | 25fff35 | 2018-08-17 15:27:20 +0300 | [diff] [blame] | 252 | osx_image: xcode10 |
onqtam | aec53d2 | 2017-05-03 06:29:47 +0300 | [diff] [blame] | 253 | os: osx |
| 254 | |
| 255 | allow_failures: |
| 256 | |
onqtam | d6e8661 | 2018-05-31 14:32:16 +0300 | [diff] [blame] | 257 | # static code analysis |
| 258 | - env: COMPILER=clang++-4.0 STATIC_CODE_ANALYSIS=true |
| 259 | |
onqtam | 2c8036f | 2016-06-26 17:12:42 +0300 | [diff] [blame] | 260 | install: |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 261 | - if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi |
| 262 | |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 263 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 264 | # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/ |
| 265 | ############################################################################ |
| 266 | |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 267 | # Make a dir for all |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 268 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" |
| 269 | - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} |
| 270 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 271 | # Install a recent CMake |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 272 | - | |
| 273 | if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then |
onqtam | 8401535 | 2017-03-15 20:11:07 +0200 | [diff] [blame] | 274 | 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] | 275 | mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake |
| 276 | export PATH=${DEPS_DIR}/cmake/bin:${PATH} |
| 277 | fi |
| 278 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 279 | # Install OCLint |
| 280 | - | |
| 281 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
onqtam | 0a2554a | 2018-05-09 13:09:58 +0300 | [diff] [blame] | 282 | 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] | 283 | mkdir oclint && travis_retry wget --no-check-certificate --quiet -O - ${OCLINT_URL} | tar --strip-components=1 -xz -C oclint |
| 284 | export PATH=${DEPS_DIR}/oclint/bin:${PATH} |
| 285 | fi |
| 286 | |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 287 | # Go back to ${TRAVIS_BUILD_DIR} |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 288 | - cd ${TRAVIS_BUILD_DIR} |
| 289 | |
| 290 | ############################################################################ |
onqtam | 0115857 | 2016-06-28 14:29:32 +0300 | [diff] [blame] | 291 | # Install stuff with homebrew under OSX |
| 292 | ############################################################################ |
onqtam | c7aaa96 | 2016-09-10 02:16:57 +0300 | [diff] [blame] | 293 | |
onqtam | 23c6a34 | 2016-06-28 14:09:10 +0300 | [diff] [blame] | 294 | - | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 295 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then |
| 296 | brew update |
| 297 | # brew install ccache |
onqtam | 27a8c08 | 2017-04-04 17:42:41 +0300 | [diff] [blame] | 298 | # brew install valgrind |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 299 | # cmake |
| 300 | if brew list -1 | grep -q "^cmake\$"; then |
| 301 | brew outdated cmake || brew upgrade cmake |
| 302 | else |
| 303 | brew install cmake |
| 304 | fi |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 305 | fi |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 306 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 307 | - export CXX="${COMPILER}" |
onqtam | 9f934f8 | 2016-08-02 12:42:19 +0300 | [diff] [blame] | 308 | # - export CXX="ccache ${COMPILER}" |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 309 | # - ccache -s |
onqtam | 7dec6aa | 2016-06-26 16:01:15 +0300 | [diff] [blame] | 310 | |
| 311 | before_script: |
| 312 | - ${CXX} --version |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 313 | |
| 314 | script: |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 315 | # coverage |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 316 | - | |
onqtam | f6d1a51 | 2017-05-01 13:56:12 +0300 | [diff] [blame] | 317 | if [[ "${CODE_COVERAGE}" = "true" ]]; then |
onqtam | 8b8f240 | 2018-05-29 19:05:14 +0300 | [diff] [blame] | 318 | 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] | 319 | make -k -j2 || exit 1 |
onqtam | 366c368 | 2019-03-19 13:58:02 +0200 | [diff] [blame] | 320 | ctest -j2 --output-on-failure || exit 1 |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 321 | |
onqtam | fdb8fcc | 2018-06-01 15:36:28 +0300 | [diff] [blame] | 322 | lcov -d . -c -o coverage.info # parse coverage data |
| 323 | lcov -r coverage.info "/usr*" -o coverage.info # remove data for system headers |
| 324 | lcov -r coverage.info "$(readlink -f examples)/*" -o coverage.info # remove data for .cpp files |
| 325 | lcov -r coverage.info "$(readlink -f scripts)/*" -o coverage.info # remove data for .cpp files |
| 326 | lcov -l coverage.info # just list a short summary of the results |
| 327 | coveralls-lcov --repo-token=${COVERALLS_REPO_TOKEN} coverage.info # upload results |
onqtam | 5a2b255 | 2017-05-01 14:03:04 +0300 | [diff] [blame] | 328 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 329 | # do not continue with other build configurations after that |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 330 | exit |
| 331 | fi |
| 332 | |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 333 | # static code analysis |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 334 | - | |
onqtam | 0decb1d | 2017-04-30 19:37:29 +0300 | [diff] [blame] | 335 | if [[ "${STATIC_CODE_ANALYSIS}" = "true" ]]; then |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 336 | # setup a test file "doctest.cpp" that is the header + a test case at the end |
| 337 | echo "#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN\n" >> doctest.cpp |
| 338 | cat doctest/doctest.h >> doctest.cpp |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 339 | echo -e "TEST_CASE(\"\") {\n\tint a = 6;\n\tSUBCASE(\"\") a = 5;\n\tCAPTURE(a);\n\tCHECK(a == 6);\n}\n" >> doctest.cpp |
| 340 | |
onqtam | ebc7da3 | 2017-05-13 21:33:19 +0300 | [diff] [blame] | 341 | # cppcheck |
| 342 | 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}" |
| 343 | |
| 344 | # oclint |
| 345 | 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] | 346 | |
| 347 | # clang-tidy |
| 348 | cd scripts/playground |
onqtam | c2b6e13 | 2017-05-08 16:37:31 +0300 | [diff] [blame] | 349 | cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . || exit 1 |
onqtam | 4d87d56 | 2018-07-03 22:23:42 +0300 | [diff] [blame] | 350 | clang-tidy-4.0 -std=c++11 -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,-clang-diagnostic-c++11-compat' || exit 1 |
onqtam | 81eab5e | 2017-05-08 11:51:20 +0300 | [diff] [blame] | 351 | |
| 352 | # do not continue with other build configurations after that |
| 353 | exit |
| 354 | fi |
onqtam | 21623a6 | 2017-04-27 21:47:46 +0300 | [diff] [blame] | 355 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 356 | # initial run with options |
onqtam | cc35030 | 2016-06-28 14:36:28 +0300 | [diff] [blame] | 357 | - cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER=${CXX} . |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 358 | |
onqtam | dd40fa9 | 2018-08-19 16:29:10 +0300 | [diff] [blame] | 359 | # set the common CXX flags |
| 360 | - export CXX_FLAGS="${CXX_FLAGS} -std=c++0x" |
| 361 | |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 362 | # debug |
| 363 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" . |
onqtam | 1586ea2 | 2016-05-21 18:02:26 +0300 | [diff] [blame] | 364 | - make clean && make -k -j2 |
onqtam | 366c368 | 2019-03-19 13:58:02 +0200 | [diff] [blame] | 365 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest -j2 --output-on-failure ; fi |
| 366 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest -j2 --output-on-failure |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 367 | # release |
| 368 | - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" . |
onqtam | 316fce2 | 2016-05-21 16:57:13 +0300 | [diff] [blame] | 369 | - make clean && make -k -j2 |
onqtam | 366c368 | 2019-03-19 13:58:02 +0200 | [diff] [blame] | 370 | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cmake -DDOCTEST_TEST_MODE=VALGRIND . && ctest -j2 --output-on-failure ; fi |
| 371 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest -j2 --output-on-failure |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 372 | |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 373 | # sanitizers - again Debug/Release configs through address/undefined/thread sanitizers |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 374 | # on separate commands because when something fails I want to see which one exactly |
onqtam | 558afbb | 2018-08-19 16:50:05 +0300 | [diff] [blame] | 375 | - cmake -DDOCTEST_TEST_MODE=NORMAL . |
| 376 | |
| 377 | - export ASAN_OPTIONS=verbosity=2:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true |
onqtam | 9e06073 | 2019-10-11 08:37:41 +0300 | [diff] [blame] | 378 | - if [[ "${HAS_ASAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${SANITIZER_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=address" . && make clean && make -k -j2 && ctest -j2 --output-on-failure ; fi |
| 379 | - if [[ "${HAS_ASAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${SANITIZER_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=address" . && make clean && make -k -j2 && ctest -j2 --output-on-failure ; fi |
onqtam | 558afbb | 2018-08-19 16:50:05 +0300 | [diff] [blame] | 380 | |
| 381 | - export UBSAN_OPTIONS=verbosity=2 |
onqtam | 366c368 | 2019-03-19 13:58:02 +0200 | [diff] [blame] | 382 | - if [[ "${HAS_UBSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${SANITIZER_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=undefined" . && make clean && make -k -j2 && ctest -j2 --output-on-failure ; fi |
| 383 | - if [[ "${HAS_UBSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${SANITIZER_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=undefined" . && make clean && make -k -j2 && ctest -j2 --output-on-failure ; fi |
onqtam | 558afbb | 2018-08-19 16:50:05 +0300 | [diff] [blame] | 384 | |
onqtam | 4391967 | 2018-08-19 17:36:09 +0300 | [diff] [blame] | 385 | - export TSAN_OPTIONS=verbosity=2:force_seq_cst_atomics=1 |
onqtam | 366c368 | 2019-03-19 13:58:02 +0200 | [diff] [blame] | 386 | - if [[ "${HAS_TSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${SANITIZER_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=thread -pie -fPIE ${TSAN_CXX_FLAGS}" . && make clean && make -k -j2 && ctest -j2 --output-on-failure ; fi |
| 387 | - if [[ "${HAS_TSAN}" = "true" ]]; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${SANITIZER_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=thread -pie -fPIE ${TSAN_CXX_FLAGS}" . && make clean && make -k -j2 && ctest -j2 --output-on-failure ; fi |
onqtam | 5cab8e9 | 2016-10-10 17:58:38 +0300 | [diff] [blame] | 388 | |
onqtam | e58aa53 | 2018-08-19 16:50:58 +0300 | [diff] [blame] | 389 | # test without rtti - just Debug |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 390 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -fno-rtti" . |
onqtam | f63c510 | 2017-02-25 20:00:52 +0200 | [diff] [blame] | 391 | - make clean && make -k -j2 |
onqtam | 366c368 | 2019-03-19 13:58:02 +0200 | [diff] [blame] | 392 | - cmake -DDOCTEST_TEST_MODE=COMPARE . && ctest -j2 --output-on-failure |
onqtam | f63c510 | 2017-02-25 20:00:52 +0200 | [diff] [blame] | 393 | |
onqtam | e58aa53 | 2018-08-19 16:50:58 +0300 | [diff] [blame] | 394 | # test only compilation without exceptions - just Debug |
onqtam | 589fd21 | 2018-08-19 16:48:17 +0300 | [diff] [blame] | 395 | - cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -fno-exceptions -DDOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS" . |
onqtam | 2d93e04 | 2017-03-17 18:57:59 +0200 | [diff] [blame] | 396 | - make clean && make -k -j2 |
| 397 | |
onqtam | e4c75fc | 2016-05-21 01:24:48 +0300 | [diff] [blame] | 398 | # - ccache -s |
| 399 | |
onqtam | 2dd5528 | 2016-06-13 18:05:38 +0300 | [diff] [blame] | 400 | #after_script: |
| 401 | # - cat compile_commands.json |