diff --git a/dist/tools/insufficient_memory/add_insufficient_memory_board.sh b/dist/tools/insufficient_memory/add_insufficient_memory_board.sh index 6423bb79e6..557afebccb 100755 --- a/dist/tools/insufficient_memory/add_insufficient_memory_board.sh +++ b/dist/tools/insufficient_memory/add_insufficient_memory_board.sh @@ -12,18 +12,53 @@ if [ -z $1 ]; then exit 1 fi +if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then + COK="\e[1;32m" + CBIG="\e[1;34m" + CNORMAL="\e[1m" + CSKIP="\e[1;36m" + CERROR="\e[1;31m" + CWARN="\e[1;33m" + CRESET="\e[0m" +else + COK= + CBIG= + CNORMAL= + CSKIP= + CERROR= + CWARN= + CRESET= +fi + BOARD=$1 RIOTBASE=$(dirname $0)/../../.. -PROJECTS+=$RIOTBASE/examples/*/Makefile -PROJECTS+=" " -PROJECTS+=$RIOTBASE/tests/*/Makefile +APPLICATIONS+=examples/*/Makefile +APPLICATIONS+=" " +APPLICATIONS+=tests/*/Makefile -for i in $PROJECTS; do - test=$(dirname $(realpath $i)); - if make BOARD=$BOARD -j -C $test 2>&1 >/dev/null | grep -e overflowed -e "not within region" > /dev/null; then - echo $(basename $test) is too big for $BOARD - make -f Makefile.for_sh -C $(dirname $0) DIR=$test BOARD=$BOARD Makefile.ci > /dev/null +# Use a standardized build within Docker and with minimal output +export BUILD_IN_DOCKER=1 +export DOCKER_MAKE_ARGS="-j4" +export RIOT_CI_BUILD=1 + +for app in ${APPLICATIONS}; do + application=$(dirname ${app}) + printf "${CNORMAL}%-40s${CRESET}" ${application} + output=$(make BOARD=${BOARD} -C ${RIOTBASE}/${application} 2>&1) + if [ $? != 0 ]; then + if echo ${output} | grep -e overflowed -e "not within region" > /dev/null; then + printf "${CBIG}%s${CRESET}\n" "too big" + make -f $(dirname $0)/Makefile.for_sh DIR=${RIOTBASE}/${application} BOARD=${BOARD} Makefile.ci > /dev/null + elif echo ${output} | grep -e "not whitelisted" -e "unsatisfied feature requirements" > /dev/null; then + printf "${CWARN}%s${CRESET}\n" "not supported" + else + printf "${CERROR}%s${CRESET}\n" "build failed" + fi else - echo $(basename $test) is OK + if echo ${output} | grep -e "skipping link step" > /dev/null; then + printf "${CSKIP}%s${CRESET}\n" "skipped" + else + printf "${COK}%s${CRESET}\n" "OK" + fi fi done