From 9817811b8f0032bd5b5d1e69d0b72c73c43f561c Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 17 Dec 2020 15:07:57 +0100 Subject: [PATCH 1/3] dist/tools/ci/static_tests.sh: add dependency check for tools --- dist/tools/ci/static_tests.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/dist/tools/ci/static_tests.sh b/dist/tools/ci/static_tests.sh index cfaccd69e4..2e43ccdbda 100755 --- a/dist/tools/ci/static_tests.sh +++ b/dist/tools/ci/static_tests.sh @@ -12,6 +12,31 @@ . $(dirname "$0")/github_annotate.sh +declare -A DEPS + +DEPS["./dist/tools/licenses/check.sh"]="head pcregrep" +DEPS["./dist/tools/doccheck/check.sh"]="doxygen tput snafu" +DEPS["./dist/tools/cppcheck/check.sh"]="cppcheck" +DEPS["./dist/tools/vera++/check.sh"]="vera++" +DEPS["./dist/tools/coccinelle/check.sh"]="spatch" +DEPS["./dist/tools/flake8/check.sh"]="python3 flake8" +DEPS["./dist/tools/codespell/check.sh"]="codespell" +DEPS["./dist/tools/uncrustify/uncrustify.sh"]="uncrustify" + +if ! command -v git 2>&1 1>/dev/null; then + echo -n "Required command 'git' for all static tests not found in PATH " >&2 + print_warning + set_result 1 + exit 1 +fi + +function print_warning { + local YELLOW="\033[0;33m" + local NO_COLOUR="\033[0m" + + echo -e "${YELLOW}•${NO_COLOUR}" +} + function print_result { local RED="\033[0;31m" local GREEN="\033[0;32m" @@ -34,6 +59,15 @@ set_result() { } function run { + for dep in ${DEPS["$1"]}; do + if ! command -v ${dep} 2>&1 1>/dev/null; then + echo -n "Required command '${dep}' for '$*' not found in PATH " >&2 + print_warning + set_result 1 + return 1 + fi + done + echo -n "Running \"$*\" " OUT=$("$@" 2>&1) NEW_RESULT=$? From 9066ab28e19da2961423f9aa493ea1058094340f Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 17 Dec 2020 15:08:34 +0100 Subject: [PATCH 2/3] make: run static_tests.sh directly with `static-tests` target --- dist/tools/ci/static_tests.sh | 6 +++--- dist/tools/static-tests.sh | 25 ------------------------- makefiles/tests.inc.mk | 2 +- 3 files changed, 4 insertions(+), 29 deletions(-) delete mode 100755 dist/tools/static-tests.sh diff --git a/dist/tools/ci/static_tests.sh b/dist/tools/ci/static_tests.sh index 2e43ccdbda..bae2eaa36d 100755 --- a/dist/tools/ci/static_tests.sh +++ b/dist/tools/ci/static_tests.sh @@ -15,7 +15,7 @@ declare -A DEPS DEPS["./dist/tools/licenses/check.sh"]="head pcregrep" -DEPS["./dist/tools/doccheck/check.sh"]="doxygen tput snafu" +DEPS["./dist/tools/doccheck/check.sh"]="doxygen tput" DEPS["./dist/tools/cppcheck/check.sh"]="cppcheck" DEPS["./dist/tools/vera++/check.sh"]="vera++" DEPS["./dist/tools/coccinelle/check.sh"]="spatch" @@ -24,7 +24,7 @@ DEPS["./dist/tools/codespell/check.sh"]="codespell" DEPS["./dist/tools/uncrustify/uncrustify.sh"]="uncrustify" if ! command -v git 2>&1 1>/dev/null; then - echo -n "Required command 'git' for all static tests not found in PATH " >&2 + echo -n "Required command 'git' for all static tests not found in PATH " print_warning set_result 1 exit 1 @@ -61,7 +61,7 @@ set_result() { function run { for dep in ${DEPS["$1"]}; do if ! command -v ${dep} 2>&1 1>/dev/null; then - echo -n "Required command '${dep}' for '$*' not found in PATH " >&2 + echo -n "Required command '${dep}' for '$*' not found in PATH " print_warning set_result 1 return 1 diff --git a/dist/tools/static-tests.sh b/dist/tools/static-tests.sh deleted file mode 100755 index 14db3a24e1..0000000000 --- a/dist/tools/static-tests.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (C) 2015 Lucas Jenß -# -# This file is subject to the terms and conditions of the GNU Lesser -# General Public License v2.1. See the file LICENSE in the top level -# directory for more details. -# - -# Change to RIOT root -cd "$(dirname "$0")/../../" - -function dep { - command -v $1 2>&1 1>/dev/null - if (( $? != 0 )); then - echo "Dependency not met: $1" - exit 1 - fi -} - -# Make sure all required commands are available -dep cppcheck -dep pcregrep - -BUILDTEST_MCU_GROUP=static-tests ./dist/tools/ci/build_and_test.sh diff --git a/makefiles/tests.inc.mk b/makefiles/tests.inc.mk index fd5e492ce6..85269dd720 100644 --- a/makefiles/tests.inc.mk +++ b/makefiles/tests.inc.mk @@ -1,3 +1,3 @@ static-test: - ./dist/tools/static-tests.sh + ./dist/tools/ci/static_tests.sh From 0a8f5e028ec4102c6d799f978e4410b9a441f5d0 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 5 Jan 2021 15:51:29 +0100 Subject: [PATCH 3/3] examples/suit_update: fix typo in README --- examples/suit_update/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/suit_update/README.md b/examples/suit_update/README.md index 90a8f4a6c3..9cfcf0bad3 100644 --- a/examples/suit_update/README.md +++ b/examples/suit_update/README.md @@ -69,7 +69,7 @@ Table of contents: ### Ble [prerequisites-ble]: #Ble -Make sure you fullfil the "Prerequisites" and "Preparing Linux" section in [README.ipv6-over-ble.md](../../pkg/nimble/README.ipv6-over-ble.md). +Make sure you fulfill the "Prerequisites" and "Preparing Linux" section in [README.ipv6-over-ble.md](../../pkg/nimble/README.ipv6-over-ble.md). ## Setup [setup]: #Setup