#!/bin/sh # src/tools/pgtest # This runs a build/initdb/regression test suite # # This will start a temporary postmaster, so you have to # have enough kernel resources to run two postmasters or # stop your main postmaster before running this script. # # Use -n to prevent 'make clean' MAKE="make" [ ! -d src ] && echo "This must be run from the top of the PostgreSQL source tree" 1>&2 && exit 1 trap "rm -rf /tmp/$$" 0 1 2 3 15 mkdir /tmp/$$ 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 # return original make error code exit `cat $TMP/ret`