Commit 3267e297 authored by Tom Lane's avatar Tom Lane

Fix a couple of portability problems in Jan's first-cut parallel test

script.  This is way cool...
parent 43499af4
#!/bin/sh #!/bin/sh
# #
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.1 1999/11/19 18:51:49 wieck Exp $ # $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.2 1999/11/20 20:21:30 tgl Exp $
# ---------- # ----------
# This is currently needed because the actual 7.0 psql makes # This is currently needed because the actual 7.0 psql makes
...@@ -96,7 +96,7 @@ SYSTEM=`/bin/sh ../../config.guess | awk -F\- '{ split($3,a,/[0-9]/); printf"%s- ...@@ -96,7 +96,7 @@ SYSTEM=`/bin/sh ../../config.guess | awk -F\- '{ split($3,a,/[0-9]/); printf"%s-
trap ' echo "" trap ' echo ""
echo "" echo ""
echo "user abort ..." echo "user abort ..."
if [ ! -z $PMPID ] if [ ! -z "$PMPID" ]
then then
echo "Signalling postmaster with PID $PMPID to shutdown immediately" echo "Signalling postmaster with PID $PMPID to shutdown immediately"
kill -2 $PMPID kill -2 $PMPID
...@@ -110,7 +110,7 @@ trap ' echo "" ...@@ -110,7 +110,7 @@ trap ' echo ""
# ---------- # ----------
# Prepare a clean check directory # Prepare a clean check directory
# ---------- # ----------
if [ -e $CHKDIR ] if [ -d $CHKDIR ]
then then
echo "=============== Removing old ./tmp_check directory ... ================" echo "=============== Removing old ./tmp_check directory ... ================"
rm -rf $CHKDIR rm -rf $CHKDIR
...@@ -126,17 +126,14 @@ mkdir -p $LOGDIR ...@@ -126,17 +126,14 @@ mkdir -p $LOGDIR
# Install this build into ./tmp/check # Install this build into ./tmp/check
# ---------- # ----------
echo "=============== Installing new build into ./tmp_check ================" echo "=============== Installing new build into ./tmp_check ================"
( ${MAKE:-gmake} -C ../.. POSTGRESDIR=$CHKDIR install >$LOGDIR/install.log 2>&1
cd ../..
make POSTGRESDIR=$CHKDIR install >$LOGDIR/install.log 2>&1
exit $?
)
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "" echo ""
echo "ERROR: Check installation failed - cannot continue" echo "ERROR: Check installation failed - cannot continue"
echo "Please examine $LOGDIR/install.log" echo "Please examine $LOGDIR/install.log"
echo "for the errors occured." echo "for the reason."
echo "" echo ""
exit 2 exit 2
fi fi
...@@ -168,9 +165,9 @@ initdb --pglib=$LIBDIR --pgdata=$PGDATA >$LOGDIR/initdb.log 2>&1 ...@@ -168,9 +165,9 @@ initdb --pglib=$LIBDIR --pgdata=$PGDATA >$LOGDIR/initdb.log 2>&1
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "" echo ""
echo "ERROR: Check installation failed - cannot continue" echo "ERROR: Check initdb failed - cannot continue"
echo "Please examine $LOGDIR/initdb.log" echo "Please examine $LOGDIR/initdb.log"
echo "for the errors occured." echo "for the reason."
echo "" echo ""
exit 3 exit 3
fi fi
...@@ -185,16 +182,17 @@ postmaster -D $PGDATA -p $PGPORT -o -F >$LOGDIR/postmaster.log 2>&1 & ...@@ -185,16 +182,17 @@ postmaster -D $PGDATA -p $PGPORT -o -F >$LOGDIR/postmaster.log 2>&1 &
PMPID=$! PMPID=$!
sleep 2 sleep 2
if ! kill -0 $PMPID >/dev/null 2>&1 if kill -0 $PMPID >/dev/null 2>&1
then then
echo "Regression postmaster is running - PID=$PMPID PGPORT=$PGPORT"
else
echo "" echo ""
echo "ERROR: Regression postmaster did not startup." echo "ERROR: Regression postmaster did not startup."
echo "Please examing $LOGDIR/postmaster.log" echo "Please examine $LOGDIR/postmaster.log"
echo "for the errors occured." echo "for the reason."
echo "" echo ""
exit 4 exit 4
fi fi
echo "Regression postmaster is running - PID=$PMPID PGPORT=$PGPORT"
# ---------- # ----------
...@@ -332,23 +330,21 @@ lno=0 ...@@ -332,23 +330,21 @@ lno=0
fi fi
# ---------- # ----------
# Tell what we're doing and start them all inside a # Tell what we're doing and start them all in background.
# subshell in background. The bourne shell's wait is # The bourne shell's wait is
# too dumb to do it smarter. I'd really like to see # too dumb to do it smarter. I'd really like to see
# the ok|failed message as soon as the individual tests # the ok|failed message as soon as the individual tests
# finish. That'd make it easier to start longer running # finish. That'd make it easier to start longer running
# ones first to increase concurrency. # ones first to increase concurrency.
# ---------- # ----------
gnam=`echo "$pargroup ($parntests tests)" | awk '{printf "%-26.26s", $line;}'` gnam=`echo "$pargroup ($parntests tests)" | awk '{printf "%-26.26s", $0;}'`
$ECHO_N "parallel $gnam ... " $ECHO_C $ECHO_N "parallel $gnam ... " $ECHO_C
( for name in $parlist ; do
for name in $parlist ; do $FRONTEND regression < sql/${name}.sql \
$FRONTEND regression < sql/${name}.sql \ > results/${name}.out 2>&1 &
> results/${name}.out 2>&1 done
done wait
wait
)
# ---------- # ----------
# Setup status information for the diff check below # Setup status information for the diff check below
......
...@@ -40,8 +40,8 @@ parallel group2 ...@@ -40,8 +40,8 @@ parallel group2
endparallel endparallel
test abstime # Depends on the reltime test test abstime # Depends on the reltime test
test horology # Depends on timespan, datetime, reltime and abstime
test geometry # Depends on point, lseg, box, path, polygon and circle test geometry # Depends on point, lseg, box, path, polygon and circle
test horology # Depends on timespan, datetime, reltime and abstime
# ---------- # ----------
# These four each depend on the previous one # These four each depend on the previous one
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment