From a6a04c4b5b0cd475ea265b63ff6ff52daf66db42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Fri, 23 Mar 2018 11:07:19 +0100 Subject: Update our tooling (Clang 5 -> 7, GCC 7 -> 8) This change permits to use up-to-date compilers, clang-tidy and clang-format It also refactor the tidy/format step to drop the binary selection from scripts and perform it directly in travis --- util/travis/before_install.sh | 6 +++--- util/travis/clangtidy.sh | 4 +--- util/travis/common.sh | 12 ++++++------ util/travis/lint.sh | 4 +--- util/travis/script.sh | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) (limited to 'util') diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh index 19c40ef90..fef054130 100755 --- a/util/travis/before_install.sh +++ b/util/travis/before_install.sh @@ -4,14 +4,14 @@ echo "Preparing for $TRAVIS_COMMIT_RANGE" . util/travis/common.sh -if [[ "${LINT}" == "1" ]]; then +if [[ ! -z "${CLANG_FORMAT}" ]]; then exit 0 fi needs_compile || exit 0 -if [[ $PLATFORM == "Unix" ]] || [[ $CLANG_TIDY == "1" ]]; then - if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ $CLANG_TIDY == "1" ]]; then +if [[ $PLATFORM == "Unix" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then + if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then install_linux_deps else install_macosx_deps diff --git a/util/travis/clangtidy.sh b/util/travis/clangtidy.sh index 7ed555693..5b00115c8 100755 --- a/util/travis/clangtidy.sh +++ b/util/travis/clangtidy.sh @@ -3,9 +3,7 @@ needs_compile || exit 0 -if hash clang-tidy-5.0 2>/dev/null; then - CLANG_TIDY=clang-tidy-5.0 -else +if [ -z "${CLANG_TIDY}" ]; then CLANG_TIDY=clang-tidy fi diff --git a/util/travis/common.sh b/util/travis/common.sh index 949540967..b4406866e 100644 --- a/util/travis/common.sh +++ b/util/travis/common.sh @@ -7,15 +7,15 @@ set_linux_compiler_env() { elif [[ "${COMPILER}" == "gcc-6" ]]; then export CC=gcc-6 export CXX=g++-6 - elif [[ "${COMPILER}" == "gcc-7" ]]; then - export CC=gcc-7 - export CXX=g++-7 + elif [[ "${COMPILER}" == "gcc-8" ]]; then + export CC=gcc-8 + export CXX=g++-8 elif [[ "${COMPILER}" == "clang-3.6" ]]; then export CC=clang-3.6 export CXX=clang++-3.6 - elif [[ "${COMPILER}" == "clang-5.0" ]]; then - export CC=clang-5.0 - export CXX=clang++-5.0 + elif [[ "${COMPILER}" == "clang-7" ]]; then + export CC=clang-7 + export CXX=clang++-7 fi } diff --git a/util/travis/lint.sh b/util/travis/lint.sh index 887e621f5..b3027c689 100644 --- a/util/travis/lint.sh +++ b/util/travis/lint.sh @@ -1,9 +1,7 @@ #! /bin/bash function perform_lint() { echo "Performing LINT..." - if hash clang-format-5.0 2>/dev/null; then - CLANG_FORMAT=clang-format-5.0 - else + if [ -z "${CLANG_FORMAT}" ]; then CLANG_FORMAT=clang-format fi echo "LINT: Using binary $CLANG_FORMAT" diff --git a/util/travis/script.sh b/util/travis/script.sh index 32e8d2e36..19aa2fdf7 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -4,7 +4,7 @@ needs_compile || exit 0 -if [[ "$LINT" == "1" ]]; then +if [[ ! -z "${CLANG_FORMAT}" ]]; then # Lint and exit CI perform_lint exit 0 -- cgit v1.2.3