From 103f940950393700c7ecb399b119c921f0234ec1 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Mon, 15 Jun 2015 01:35:53 +0530 Subject: [PATCH] contrib/check-hard: Indentation and spacing cleanup * contrib/check-hard: Reduce the amount of text output to the screen. Also implement some indentation and whitespace cleanups. --- contrib/check-hard | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/contrib/check-hard b/contrib/check-hard index d481be6b..f7c54a7b 100755 --- a/contrib/check-hard +++ b/contrib/check-hard @@ -2,13 +2,15 @@ # # Do some checking before 'git push'. -CORES=`grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 0` +# Set a stricter bash mode +set -e +set -u + +CORES=$(grep -c ^processor /proc/cpuinfo 2> /dev/null || echo 0) if [ $CORES -lt 1 ]; then CORES=1; fi -make -f Makefile distclean 2>/dev/null - -# automatically exit on error -set -e +echo "Running: make distclean" +make distclean > /dev/null || true CFLAGS="-std=c89 -pedantic -O2 -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition" @@ -17,13 +19,13 @@ CACHEFILE=$PWD/config_check.cache # measure time consumed and print it at the end of the script START=$(date +%s.%N) -echo "./bootstrap" -./bootstrap >/dev/null +echo "Running: ./bootstrap" +./bootstrap > /dev/null echo for CC in gcc clang; do export CC - echo "*** checking CC=$CC" + echo "*** Testing with CC=$CC" # the compiler changed, so we have to remove the cache file here rm -f $CACHEFILE @@ -31,20 +33,20 @@ for CC in gcc clang; do for options in "" "--with-ssl=openssl"; do export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE $options" echo " ./configure $DISTCHECK_CONFIGURE_FLAGS" - ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" >/dev/null + ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" > /dev/null for xVALGRIND in 0 1; do for xLCALL in C tr_TR.utf8; do export TESTS_ENVIRONMENT="LC_ALL=$xLCALL VALGRIND_TESTS=$xVALGRIND" echo " TESTS_ENVIRONMENT=\"$TESTS_ENVIRONMENT\"" make check -j$CORES - make check -j$CORES >/dev/null + make check -j$CORES > /dev/null done done unset TESTS_ENVIRONMENT export TESTS_ENVIRONMENT - echo " make distcheck -j$CORES" - make distcheck CFLAGS="$CFLAGS" -j$CORES + echo " make distcheck CFLAGS=$CFLAGS -j$CORES" + make distcheck CFLAGS="$CFLAGS" -j$CORES > /dev/null done done