2006-03-11 05:38:42 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/tools/pgtest
|
2003-06-22 06:22:57 +02:00
|
|
|
|
|
|
|
# This runs a build/initdb/regression test suite
|
2003-06-27 23:46:20 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2011-12-30 22:29:25 +01:00
|
|
|
# Use -n to prevent 'make clean'
|
|
|
|
|
|
|
|
MAKE="make"
|
2003-06-22 06:22:57 +02:00
|
|
|
|
|
|
|
[ ! -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/$$"
|
|
|
|
|
2003-06-27 23:46:20 +02:00
|
|
|
[ "X$1" != "X-n" ] && PGCLEAN=clean
|
2003-06-22 06:22:57 +02:00
|
|
|
|
2012-08-10 20:10:34 +02:00
|
|
|
# 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
|
|
|
|
|
2011-12-30 22:29:25 +01:00
|
|
|
($MAKE $PGCLEAN check 2>&1; echo "$?" > $TMP/ret) |
|
2003-06-22 06:22:57 +02:00
|
|
|
(tee $TMP/0; exit `cat $TMP/ret`) &&
|
2003-06-27 23:46:20 +02:00
|
|
|
cat $TMP/0 |
|
2010-11-23 21:27:50 +01:00
|
|
|
# The following grep's have to be adjusted for your setup because
|
2003-06-23 21:33:25 +02:00
|
|
|
# certain warnings are acceptable.
|
2010-11-23 21:27:50 +01:00
|
|
|
grep -i warning |
|
|
|
|
grep -v setproctitle |
|
|
|
|
grep -v find_rule |
|
2004-09-09 11:57:23 +02:00
|
|
|
grep -v yy_flex_realloc
|
2012-08-10 20:10:34 +02:00
|
|
|
|
|
|
|
# return original make error code
|
|
|
|
exit `cat $TMP/ret`
|