Skip to content

Commit 4872b19

Browse files
committed
zproject_travis.gsl : add shadow compilation (optionally non-fatal) with modern GCC and/or CLANG versions
1 parent 46968a2 commit 4872b19

File tree

3 files changed

+148
-1
lines changed

3 files changed

+148
-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: 144 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,134 @@ matrix:
227227
- *pkg_deps_devtools
228228
- *pkg_deps_zproject
229229
.endif
230+
.if defined (project.travis_shadow_clang) & !(project.travis_shadow_clang ?= 0)
231+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
232+
os: linux
233+
.if (project.travis_dist ?<> "")
234+
dist: $(project.travis_dist)
235+
.endif
236+
addons:
237+
apt:
238+
sources:
239+
- llvm-toolchain-trusty-5.0
240+
.if (pkg_src_zeromq_dist ?<> "")
241+
- *$(pkg_src_zeromq_dist)
242+
.endif
243+
packages:
244+
- *pkg_deps_common
245+
- clang-5.0
246+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
247+
os: linux
248+
.if (project.travis_dist ?<> "")
249+
dist: $(project.travis_dist)
250+
.endif
251+
addons:
252+
apt:
253+
sources:
254+
- llvm-toolchain-trusty-4.0
255+
.if (pkg_src_zeromq_dist ?<> "")
256+
- *$(pkg_src_zeromq_dist)
257+
.endif
258+
packages:
259+
- *pkg_deps_common
260+
- clang-4.0
261+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
262+
os: linux
263+
.if (project.travis_dist ?<> "")
264+
dist: $(project.travis_dist)
265+
.endif
266+
addons:
267+
apt:
268+
sources:
269+
- llvm-toolchain-trusty-3.9
270+
.if (pkg_src_zeromq_dist ?<> "")
271+
- *$(pkg_src_zeromq_dist)
272+
.endif
273+
packages:
274+
- *pkg_deps_common
275+
- clang-3.9
276+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
277+
os: linux
278+
.if (project.travis_dist ?<> "")
279+
dist: $(project.travis_dist)
280+
.endif
281+
addons:
282+
apt:
283+
sources:
284+
- llvm-toolchain-trusty-3.8
285+
.if (pkg_src_zeromq_dist ?<> "")
286+
- *$(pkg_src_zeromq_dist)
287+
.endif
288+
packages:
289+
- *pkg_deps_common
290+
- clang-3.8
291+
.endif
292+
.if defined (project.travis_shadow_gcc) & !(project.travis_shadow_gcc ?= 0)
293+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
294+
os: linux
295+
.if (project.travis_dist ?<> "")
296+
dist: $(project.travis_dist)
297+
.endif
298+
addons:
299+
apt:
300+
sources:
301+
- ubuntu-toolchain-r-test
302+
.if (pkg_src_zeromq_dist ?<> "")
303+
- *$(pkg_src_zeromq_dist)
304+
.endif
305+
packages:
306+
- *pkg_deps_common
307+
- g++-4.9
308+
- gcc-4.9
309+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
310+
os: linux
311+
.if (project.travis_dist ?<> "")
312+
dist: $(project.travis_dist)
313+
.endif
314+
addons:
315+
apt:
316+
sources:
317+
- ubuntu-toolchain-r-test
318+
.if (pkg_src_zeromq_dist ?<> "")
319+
- *$(pkg_src_zeromq_dist)
320+
.endif
321+
packages:
322+
- *pkg_deps_common
323+
- g++-5
324+
- gcc-5
325+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
326+
os: linux
327+
.if (project.travis_dist ?<> "")
328+
dist: $(project.travis_dist)
329+
.endif
330+
addons:
331+
apt:
332+
sources:
333+
- ubuntu-toolchain-r-test
334+
.if (pkg_src_zeromq_dist ?<> "")
335+
- *$(pkg_src_zeromq_dist)
336+
.endif
337+
packages:
338+
- *pkg_deps_common
339+
- g++-6
340+
- gcc-6
341+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
342+
os: linux
343+
.if (project.travis_dist ?<> "")
344+
dist: $(project.travis_dist)
345+
.endif
346+
addons:
347+
apt:
348+
sources:
349+
- ubuntu-toolchain-r-test
350+
.if (pkg_src_zeromq_dist ?<> "")
351+
- *$(pkg_src_zeromq_dist)
352+
.endif
353+
packages:
354+
- *pkg_deps_common
355+
- g++-7
356+
- gcc-7
357+
.endif
230358
.if project.travis_clangformat_implem ?= "autotools" | ( !defined(project.travis_clangformat_implem) & project.travis_use_cmake ?= 0 )
231359
. echo "TRAVIS: CLANG-FORMAT: implementation: autotools"
232360
### Note: we don't use CMake
@@ -255,7 +383,7 @@ matrix:
255383
#autotools#\
256384
.endif
257385
- *pkg_deps_prereqs
258-
.if project.travis_clangformat_allow_failures ?= 1 | project.travis_distcheck ?= 2
386+
.if project.travis_clangformat_allow_failures ?= 1 | project.travis_distcheck ?= 2 | project.travis_shadow_gcc ?=2 | project.travis_shadow_clang ?= 2
259387
# Note: "env" lines below must exactly describe a matrix option defined above
260388
allow_failures:
261389
. if project.travis_distcheck ?= 2
@@ -266,6 +394,20 @@ matrix:
266394
. echo "TRAVIS: CHECK_ZPROJECT: allow-fail: true"
267395
- env: BUILD_TYPE=check_zproject
268396
. endif
397+
. if project.travis_shadow_gcc ?= 2
398+
. echo "TRAVIS: Shadow GCC versions: allow-fail: true"
399+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
400+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
401+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
402+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
403+
. endif
404+
. if project.travis_shadow_clang ?= 2
405+
. echo "TRAVIS: Shadow CLANG versions: allow-fail: true"
406+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
407+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
408+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
409+
- env: BUILD_TYPE=default-Werror MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
410+
. endif
269411
. if project.travis_clangformat_allow_failures ?= 1
270412
. echo "TRAVIS: CLANG-FORMAT: allow-fail: true"
271413
. if project.travis_clangformat_implem ?= "autotools" | ( !defined(project.travis_clangformat_implem) & project.travis_use_cmake ?= 0 )
@@ -303,6 +445,7 @@ matrix:
303445
before_install:
304446
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "android" ] ; then brew install binutils ; fi
305447
- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "valgrind" ] ; then brew install valgrind ; fi
448+
- if [ -n "\${MATRIX_EVAL}" ] ; then eval \${MATRIX_EVAL} ; fi
306449

307450
# Hand off to generated script for each BUILD_TYPE
308451
script: ./ci_build.sh

0 commit comments

Comments
 (0)