From: Bruce Momjian Date: Fri, 10 Aug 2012 20:46:02 +0000 (-0400) Subject: Adjust pgtest coding to be less complex. X-Git-Tag: REL9_3_BETA1~1112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=914b1301cc7b4c1ffba9f4c037e6e76f8e787e05;p=postgresql Adjust pgtest coding to be less complex. --- diff --git a/src/tools/pgtest b/src/tools/pgtest index c160f58320..cca7f03b08 100755 --- a/src/tools/pgtest +++ b/src/tools/pgtest @@ -20,19 +20,20 @@ TMP="/tmp/$$" [ "X$1" != "X-n" ] && PGCLEAN=clean -# run make check, capture return code in $TMP/ret, then display -# that but capture it in $TMP/0 too, and return original make -# error code. If that succeded, display captured warnings - -($MAKE $PGCLEAN check 2>&1; echo "$?" > $TMP/ret) | - (tee $TMP/0; exit `cat $TMP/ret`) && -cat $TMP/0 | -# The following grep's have to be adjusted for your setup because -# certain warnings are acceptable. -grep -i warning | -grep -v setproctitle | -grep -v find_rule | -grep -v yy_flex_realloc +# Run "make check" and store return code in $TMP/ret. +# Display output but also capture it in $TMP/0. +($MAKE $PGCLEAN check 2>&1; echo "$?" > $TMP/ret) | tee $TMP/0 + +# If success, display warnings +if [ $(cat $TMP/ret) -eq 0 ] +then cat $TMP/0 | + # The following grep's have to be adjusted for your setup because + # certain warnings are acceptable. + grep -i warning | + grep -v setproctitle | + grep -v find_rule | + grep -v yy_flex_realloc +fi # return original make error code exit `cat $TMP/ret`