• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1language: cpp
2
3branches:
4  except:
5  - /dev-appveyor.*/
6
7common_sources: &all_sources
8  - ubuntu-toolchain-r-test
9  - llvm-toolchain-trusty
10  - llvm-toolchain-trusty-3.9
11  - llvm-toolchain-trusty-4.0
12  - llvm-toolchain-trusty-5.0
13  - llvm-toolchain-trusty-6.0
14
15matrix:
16  include:
17
18    # 1/ Linux Clang Builds
19    - os: linux
20      compiler: clang
21      addons:
22        apt:
23          sources: *all_sources
24          packages: ['clang-3.5']
25      env: COMPILER='clang++-3.5'
26
27    - os: linux
28      compiler: clang
29      addons:
30        apt:
31          sources: *all_sources
32          packages: ['clang-3.6']
33      env: COMPILER='clang++-3.6'
34
35    # Clang 3.7 is intentionally skipped as we cannot get it easily on
36    # TravisCI container
37
38    - os: linux
39      compiler: clang
40      addons:
41        apt:
42          sources: *all_sources
43          packages: ['lcov', 'clang-3.8']
44      env: COMPILER='clang++-3.8'
45
46    - os: linux
47      compiler: clang
48      addons:
49          apt:
50              sources: *all_sources
51              packages: ['clang-3.9']
52      env: COMPILER='clang++-3.9'
53
54    - os: linux
55      compiler: clang
56      addons:
57          apt:
58              sources: *all_sources
59              packages: ['clang-4.0']
60      env: COMPILER='clang++-4.0'
61
62    - os: linux
63      compiler: clang
64      addons:
65          apt:
66              sources: *all_sources
67              packages: ['clang-5.0']
68      env: COMPILER='clang++-5.0'
69
70    - os: linux
71      compiler: clang
72      addons:
73          apt:
74              sources: *all_sources
75              packages: ['clang-6.0']
76      env: COMPILER='clang++-6.0'
77
78    # 2/ Linux GCC Builds
79    - os: linux
80      compiler: gcc
81      addons:
82        apt:
83         sources: *all_sources
84         packages: ['g++-4.8']
85      env: COMPILER='g++-4.8'
86
87    - os: linux
88      compiler: gcc
89      addons:
90        apt:
91          sources: *all_sources
92          packages: ['g++-4.9']
93      env: COMPILER='g++-4.9'
94
95    - os: linux
96      compiler: gcc
97      addons:
98        apt:
99          sources: *all_sources
100          packages: ['g++-5']
101      env: COMPILER='g++-5'
102
103    - os: linux
104      compiler: gcc
105      addons: &gcc6
106        apt:
107          sources: *all_sources
108          packages: ['g++-6']
109      env: COMPILER='g++-6'
110
111    - os: linux
112      compiler: gcc
113      addons: &gcc7
114        apt:
115          sources: *all_sources
116          packages: ['g++-7']
117      env: COMPILER='g++-7'
118
119    - os: linux
120      compiler: gcc
121      addons: &gcc8
122        apt:
123          sources: *all_sources
124          packages: ['g++-8']
125      env: COMPILER='g++-8'
126
127    # 3b/ Linux C++14 Clang builds
128    # Note that we need newer libstdc++ for C++14 support
129    - os: linux
130      compiler: clang
131      addons:
132          apt:
133              packages: ['clang-3.8', 'libstdc++-6-dev']
134              sources:
135                  - ubuntu-toolchain-r-test
136                  - llvm-toolchain-trusty
137      env: COMPILER='clang++-3.8' CPP14=1
138
139    - os: linux
140      compiler: clang
141      addons:
142          apt:
143              sources: *all_sources
144              packages: ['clang-3.9', 'libstdc++-6-dev']
145      env: COMPILER='clang++-3.9' CPP14=1
146
147    - os: linux
148      compiler: clang
149      addons:
150          apt:
151              sources: *all_sources
152              packages: ['clang-4.0', 'libstdc++-6-dev']
153      env: COMPILER='clang++-4.0' CPP14=1
154
155    - os: linux
156      compiler: clang
157      addons:
158          apt:
159              sources: *all_sources
160              packages: ['clang-5.0', 'libstdc++-6-dev']
161      env: COMPILER='clang++-5.0' CPP14=1
162
163    - os: linux
164      compiler: clang
165      addons:
166          apt:
167              sources: *all_sources
168              packages: ['clang-6.0', 'libstdc++-6-dev']
169      env: COMPILER='clang++-6.0' CPP14=1
170
171
172    # 4a/ Linux C++14 GCC builds
173    - os: linux
174      compiler: gcc
175      addons: *gcc6
176      env: COMPILER='g++-6' CPP14=1
177
178    - os: linux
179      compiler: gcc
180      addons: *gcc7
181      env: COMPILER='g++-7' CPP14=1
182
183    - os: linux
184      compiler: gcc
185      addons: *gcc8
186      env: COMPILER='g++-8' CPP14=1
187
188    # 5/ OSX Clang Builds
189    - os: osx
190      osx_image: xcode7.3
191      compiler: clang
192      env: COMPILER='clang++'
193
194    - os: osx
195      osx_image: xcode8
196      compiler: clang
197      env: COMPILER='clang++'
198
199    - os: osx
200      osx_image: xcode9
201      compiler: clang
202      env: COMPILER='clang++'
203
204    - os: osx
205      osx_image: xcode9.1
206      compiler: clang
207      env: COMPILER='clang++'
208
209    - os: osx
210      osx_image: xcode9.1
211      compiler: clang
212      env: COMPILER='clang++' CPP14=1
213
214    # 6/ Special builds -- examples, coverage, valgrind, etc.
215    - os: linux
216      compiler: gcc
217      addons:
218        apt:
219          sources: *all_sources
220          packages: ['lcov', 'g++-7']
221      env: COMPILER='g++-7' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
222
223    - os: linux
224      compiler: clang
225      addons:
226        apt:
227          packages: ['clang-3.8', 'lcov']
228          sources:
229            - ubuntu-toolchain-r-test
230            - llvm-toolchain-trusty
231      env: COMPILER='clang++-3.8' EXAMPLES=1 COVERAGE=1 EXTRAS=1
232
233    - os: linux
234      compiler: gcc
235      addons:
236        apt:
237          sources: *all_sources
238          packages: ['valgrind', 'lcov', 'g++-7']
239      env: COMPILER='g++-7' CPP14=1 VALGRIND=1
240
241    - os: osx
242      osx_image: xcode9.1
243      compiler: clang
244      env: COMPILER='clang++' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
245
246    # 7/ C++17 builds
247    - os: linux
248      compiler: gcc
249      addons: *gcc7
250      env: COMPILER='g++-7' CPP17=1
251
252    - os: linux
253      compiler: gcc
254      addons: *gcc7
255      env: COMPILER='g++-7' EXAMPLES=1 COVERAGE=1 EXTRAS=1 CPP17=1
256
257    - os: linux
258      compiler: clang
259      addons:
260          apt:
261              sources: *all_sources
262              packages: ['clang-6.0', 'libstdc++-8-dev']
263      env: COMPILER='clang++-6.0' CPP17=1
264
265    - os: linux
266      compiler: clang
267      addons:
268          apt:
269              sources: *all_sources
270              packages: ['clang-6.0', 'libstdc++-8-dev']
271      env: COMPILER='clang++-6.0' CPP17=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1
272
273    # 8/ Conan
274    - language: python
275      python:
276        - "3.7"
277      dist: xenial
278      install:
279        - pip install conan==1.10.2 conan-package-tools
280      env:
281        - CONAN_GCC_VERSIONS=8
282        - CONAN_DOCKER_IMAGE=conanio/gcc8
283      script:
284        - python .conan/build.py
285
286install:
287  - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
288  - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
289  - |
290    if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
291      CMAKE_URL="http://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz"
292      mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
293      export PATH=${DEPS_DIR}/cmake/bin:${PATH}
294    elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
295        which cmake || brew install cmake;
296    fi
297
298before_script:
299  - export CXX=${COMPILER}
300  - cd ${TRAVIS_BUILD_DIR}
301  # Regenerate single header file, so it is tested in the examples...
302  - python scripts/generateSingleHeader.py
303
304    # Use Debug builds for running Valgrind and building examples
305  - cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DUSE_CPP14=${CPP14} -DUSE_CPP17=${CPP17} -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=${EXAMPLES} -DCATCH_ENABLE_COVERAGE=${COVERAGE} -DCATCH_BUILD_EXTRA_TESTS=${EXTRAS}
306    # Don't bother with release build for coverage build
307  - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DUSE_CPP14=${CPP14} -DUSE_CPP17=${CPP17}
308
309
310script:
311  - cd Build-Debug
312  - make -j 2
313  - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
314    # Coverage collection does not work for OS X atm
315  - |
316    if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${COVERAGE}" == "1" ]]; then
317      make gcov
318      make lcov
319      bash <(curl -s https://codecov.io/bash) -X gcov || echo "Codecov did not collect coverage reports"
320    fi
321  - # Go to release build
322  - cd ../Build-Release
323  - make -j 2
324  - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
325