Skip to content

Commit 76c775f

Browse files
authored
Merge pull request #1176 from jimklimov/shadow-travis
Problem : outdated coding patterns come as a surprise with new compilers
2 parents 46968a2 + de17c8a commit 76c775f

File tree

3 files changed

+151
-1
lines changed

3 files changed

+151
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ zproject's `project.xml` contains an extensive description of the available conf
206206
<option name="clangformat_implem" value="cmake|autotools" /> will pick one of two implems of the clang-format test in Travis CI (cmake is default and faster if available, since autotools needs to configure first)
207207
<option name="check_abi_compliance" value="0" /> "1" will compare the currently tested commit's ABI to the one in a "latest_release" branch or tag, using packaged prerequisites. Due to these limitations, the option is off by default.
208208
<option name="check_zproject" value="0" /> "1" will regenerate the zproject of the tested commit, and will verify that nothing changed, "2" will enable it as a special testcase allowed to fail. Many projects do customize their originally generated codebase, so to avoid surprises this option is off by default.
209+
<option name="shadow_gcc" value="0" /> "1" will enable builds with warnings configured as fatal in additional recent versions of GCC, and "2" will make failures in these cases non-fatal so you can take time to modernize your code with modern best practices in mind. This is off "0" by default.
210+
<option name="shadow_clang" value="0" /> "1" will enable builds with warnings configured as fatal in additional recent versions of CLANG, and "2" will make failures in these cases non-fatal so you can take time to modernize your code with modern best practices in mind. This is off "0" by default.
209211
vs2008 Microsoft Visual Studio 2008
210212
vs2010 Microsoft Visual Studio 2010
211213
vs2012 Microsoft Visual Studio 2012

project.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<option name="clangformat_implem" value="cmake|autotools" /> will pick one of two implems of the clang-format test in Travis CI (cmake is default and faster if available, since autotools needs to configure first)
3030
<option name="check_abi_compliance" value="0" /> "1" will compare the currently tested commit's ABI to the one in a "latest_release" branch or tag, using packaged prerequisites. Due to these limitations, the option is off by default.
3131
<option name="check_zproject" value="0" /> "1" will regenerate the zproject of the tested commit, and will verify that nothing changed, "2" will enable it as a special testcase allowed to fail. Many projects do customize their originally generated codebase, so to avoid surprises this option is off by default.
32+
<option name="shadow_gcc" value="0" /> "1" will enable builds with warnings configured as fatal in additional recent versions of GCC, and "2" will make failures in these cases non-fatal so you can take time to modernize your code with modern best practices in mind. This is off "0" by default.
33+
<option name="shadow_clang" value="0" /> "1" will enable builds with warnings configured as fatal in additional recent versions of CLANG, and "2" will make failures in these cases non-fatal so you can take time to modernize your code with modern best practices in mind. This is off "0" by default.
3234
vs2008 Microsoft Visual Studio 2008
3335
vs2010 Microsoft Visual Studio 2010
3436
vs2012 Microsoft Visual Studio 2012

zproject_travis.gsl

Lines changed: 147 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,137 @@ matrix:
227227
- *pkg_deps_devtools
228228
- *pkg_deps_zproject
229229
.endif
230+
.if (defined (project.travis_shadow_clang) & !(project.travis_shadow_clang ?= 0)) | (defined (project.travis_shadow_gcc) & !(project.travis_shadow_gcc ?= 0))
231+
# Shadow-compilation setups below inspired by https://docs.travis-ci.com/user/languages/cpp/
232+
.endif
233+
.if defined (project.travis_shadow_clang) & !(project.travis_shadow_clang ?= 0)
234+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
235+
os: linux
236+
.if (project.travis_dist ?<> "")
237+
dist: $(project.travis_dist)
238+
.endif
239+
addons:
240+
apt:
241+
sources:
242+
- llvm-toolchain-trusty-5.0
243+
.if (pkg_src_zeromq_dist ?<> "")
244+
- *$(pkg_src_zeromq_dist)
245+
.endif
246+
packages:
247+
- *pkg_deps_common
248+
- clang-5.0
249+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
250+
os: linux
251+
.if (project.travis_dist ?<> "")
252+
dist: $(project.travis_dist)
253+
.endif
254+
addons:
255+
apt:
256+
sources:
257+
- llvm-toolchain-trusty-4.0
258+
.if (pkg_src_zeromq_dist ?<> "")
259+
- *$(pkg_src_zeromq_dist)
260+
.endif
261+
packages:
262+
- *pkg_deps_common
263+
- clang-4.0
264+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
265+
os: linux
266+
.if (project.travis_dist ?<> "")
267+
dist: $(project.travis_dist)
268+
.endif
269+
addons:
270+
apt:
271+
sources:
272+
- llvm-toolchain-trusty-3.9
273+
.if (pkg_src_zeromq_dist ?<> "")
274+
- *$(pkg_src_zeromq_dist)
275+
.endif
276+
packages:
277+
- *pkg_deps_common
278+
- clang-3.9
279+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
280+
os: linux
281+
.if (project.travis_dist ?<> "")
282+
dist: $(project.travis_dist)
283+
.endif
284+
addons:
285+
apt:
286+
sources:
287+
- llvm-toolchain-trusty-3.8
288+
.if (pkg_src_zeromq_dist ?<> "")
289+
- *$(pkg_src_zeromq_dist)
290+
.endif
291+
packages:
292+
- *pkg_deps_common
293+
- clang-3.8
294+
.endif
295+
.if defined (project.travis_shadow_gcc) & !(project.travis_shadow_gcc ?= 0)
296+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
297+
os: linux
298+
.if (project.travis_dist ?<> "")
299+
dist: $(project.travis_dist)
300+
.endif
301+
addons:
302+
apt:
303+
sources:
304+
- ubuntu-toolchain-r-test
305+
.if (pkg_src_zeromq_dist ?<> "")
306+
- *$(pkg_src_zeromq_dist)
307+
.endif
308+
packages:
309+
- *pkg_deps_common
310+
- g++-4.9
311+
- gcc-4.9
312+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
313+
os: linux
314+
.if (project.travis_dist ?<> "")
315+
dist: $(project.travis_dist)
316+
.endif
317+
addons:
318+
apt:
319+
sources:
320+
- ubuntu-toolchain-r-test
321+
.if (pkg_src_zeromq_dist ?<> "")
322+
- *$(pkg_src_zeromq_dist)
323+
.endif
324+
packages:
325+
- *pkg_deps_common
326+
- g++-5
327+
- gcc-5
328+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
329+
os: linux
330+
.if (project.travis_dist ?<> "")
331+
dist: $(project.travis_dist)
332+
.endif
333+
addons:
334+
apt:
335+
sources:
336+
- ubuntu-toolchain-r-test
337+
.if (pkg_src_zeromq_dist ?<> "")
338+
- *$(pkg_src_zeromq_dist)
339+
.endif
340+
packages:
341+
- *pkg_deps_common
342+
- g++-6
343+
- gcc-6
344+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
345+
os: linux
346+
.if (project.travis_dist ?<> "")
347+
dist: $(project.travis_dist)
348+
.endif
349+
addons:
350+
apt:
351+
sources:
352+
- ubuntu-toolchain-r-test
353+
.if (pkg_src_zeromq_dist ?<> "")
354+
- *$(pkg_src_zeromq_dist)
355+
.endif
356+
packages:
357+
- *pkg_deps_common
358+
- g++-7
359+
- gcc-7
360+
.endif
230361
.if project.travis_clangformat_implem ?= "autotools" | ( !defined(project.travis_clangformat_implem) & project.travis_use_cmake ?= 0 )
231362
. echo "TRAVIS: CLANG-FORMAT: implementation: autotools"
232363
### Note: we don't use CMake
@@ -255,7 +386,7 @@ matrix:
255386
#autotools#\
256387
.endif
257388
- *pkg_deps_prereqs
258-
.if project.travis_clangformat_allow_failures ?= 1 | project.travis_distcheck ?= 2
389+
.if project.travis_clangformat_allow_failures ?= 1 | project.travis_distcheck ?= 2 | project.travis_shadow_gcc ?=2 | project.travis_shadow_clang ?= 2
259390
# Note: "env" lines below must exactly describe a matrix option defined above
260391
allow_failures:
261392
. if project.travis_distcheck ?= 2
@@ -266,6 +397,20 @@ matrix:
266397
. echo "TRAVIS: CHECK_ZPROJECT: allow-fail: true"
267398
- env: BUILD_TYPE=check_zproject
268399
. endif
400+
. if project.travis_shadow_gcc ?= 2
401+
. echo "TRAVIS: Shadow GCC versions: allow-fail: true"
402+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
403+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
404+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
405+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
406+
. endif
407+
. if project.travis_shadow_clang ?= 2
408+
. echo "TRAVIS: Shadow CLANG versions: allow-fail: true"
409+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
410+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
411+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
412+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
413+
. endif
269414
. if project.travis_clangformat_allow_failures ?= 1
270415
. echo "TRAVIS: CLANG-FORMAT: allow-fail: true"
271416
. if project.travis_clangformat_implem ?= "autotools" | ( !defined(project.travis_clangformat_implem) & project.travis_use_cmake ?= 0 )
@@ -303,6 +448,7 @@ matrix:
303448
before_install:
304449
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "android" ] ; then brew install binutils ; fi
305450
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "valgrind" ] ; then brew install valgrind ; fi
451+
- if [ -n "\${MATRIX_EVAL}" ] ; then eval \${MATRIX_EVAL} ; fi
306452

307453
# Hand off to generated script for each BUILD_TYPE
308454
script: ./ci_build.sh

0 commit comments

Comments
 (0)