diff options
Diffstat (limited to 'tools/ci/scripts/init.sh')
-rwxr-xr-x | tools/ci/scripts/init.sh | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index 9512e9b66..396dae182 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -2,8 +2,10 @@ export dir=$(pwd) export ERRFILE=${dir}/logs/${LOGFILE} +export ERRFILE_UNFILTERED=${ERRFILE%.log}.unfiltered.log -rm ${ERRFILE} +rm -f "$ERRFILE" +rm -f "$ERRFILE_UNFILTERED" function do_init { $CC --version @@ -104,11 +106,11 @@ function check_error { } function run_configure_simple { - rm $ERRFILE + rm -f "$ERRFILE" echo "autoreconf -i" autoreconf -i 2>$ERRFILE check_error $? - rm $ERRFILE + rm -f "$ERRFILE" echo "./configure $*" ./configure $* 2>$ERRFILE check_error $? @@ -117,14 +119,14 @@ function run_configure_simple { function run_configure { run_configure_simple $* - rm $ERRFILE + rm -f "$ERRFILE" cd po echo "make update-gmo" make update-gmo 2>$ERRFILE check_error $? cd .. - rm $ERRFILE + rm -f "$ERRFILE" cd po echo "make update-po" make update-po 2>$ERRFILE @@ -133,14 +135,14 @@ function run_configure { } function run_cmake { - rm $ERRFILE + rm -f "$ERRFILE" echo "cmake ." cmake . 2>$ERRFILE check_error $? } function run_make { - rm $ERRFILE + rm -f "$ERRFILE" if [ "$JOBS" == "" ]; then export JOBS=2 echo "No JOBS defined" @@ -150,10 +152,20 @@ function run_make { echo "make -j${JOBS} V=0 $*" make -j${JOBS} V=0 $* 2>$ERRFILE check_error $? + + for path in "src/manaplus" "src/dyecmd"; do + if [[ -f "$path" ]]; then + stat -c '%s %n' "$path" + strip -o "$path.stripped" "$path" + stat -c '%s %n' "$path.stripped" + else + printf "%s does not exist, no strip & exe size summary\n" "$path" + fi + done } function run_make_check { - rm $ERRFILE + rm -f "$ERRFILE" if [ "$JOBS" == "" ]; then export JOBS=2 echo "No JOBS defined" @@ -205,13 +217,19 @@ function run_gcov { function run_check_warnings { if [[ -s "$ERRFILE" ]]; then + printf "Warnings detected in %s:\n" "$ERRFILE" cat $ERRFILE exit 1 fi + + if [[ -s "$ERRFILE_UNFILTERED" ]]; then + printf "Warnings detected in %s. The maintainer might want to take a peek, sometimes.\n" \ + "$ERRFILE_UNFILTERED" + fi } function run_h { - rm $ERRFILE + rm -f "$ERRFILE" echo "$CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h" $CC -c -x c++ $* $includes */*/*/*/*.h */*/*/*.h */*/*.h */*.h *.h 2>$ERRFILE if [[ -s "$ERRFILE" ]]; then @@ -221,7 +239,7 @@ function run_h { } function run_tarball { - rm $ERRFILE + rm -f "$ERRFILE" echo "make dist-xz" make dist-xz 2>$ERRFILE check_error $? @@ -234,14 +252,17 @@ function run_tarball { } function run_mplint { - rm $ERRFILE - echo "mplint/src/mplint $*" - mplint/src/mplint "$@" \ - | grep -v \ - -e "src/unittests/doctest.h" \ - -e "src/unittests/catch.hpp" \ - -e "src/debug/" \ - > "$ERRFILE" + rm -f "$ERRFILE" + echo "\$ ./mplint $*" + + ./mplint "$@" > "$ERRFILE.unfiltered" + + # if grep does not find any messages, it exits non-zero + grep -v \ + -e "src/unittests/doctest.h" \ + -e "src/unittests/catch.hpp" \ + -e "src/debug/" \ + < "$ERRFILE.unfiltered" > "$ERRFILE" || true run_check_warnings } |