aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-07-17 18:28:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-07-17 18:28:45 +0000
commitd0f312ebfe09692f7d213da6c7c6277b438d3d10 (patch)
treee13a3531afad1aaade9b574e0ade276c34a6eb6e /src
parent59857b46a8e3daf0f7c0794a853b8601ea3f2535 (diff)
downloadpostgresql-d0f312ebfe09692f7d213da6c7c6277b438d3d10.tar.gz
postgresql-d0f312ebfe09692f7d213da6c7c6277b438d3d10.zip
Make pg_regress accept a command-line option for the temporary installation's
port number, and use a default value for it that is dependent on the configuration-time DEF_PGPORT. Should make the world safe for running parallel 'make check' in different branches. Back-patch as far as 7.4 so that this actually is useful.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/GNUmakefile9
-rw-r--r--src/test/regress/pg_regress.sh15
2 files changed, 19 insertions, 5 deletions
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index 381163808ae..fec8983e1d5 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
-# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.49 2005/05/11 21:52:03 tgl Exp $
+# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.50 2005/07/17 18:28:45 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -22,6 +22,9 @@ override CFLAGS += $(CFLAGS_SL)
SHLIB_LINK = $(BE_DLLLIBS)
+# port number for temp-installation test postmaster
+TEMP_PORT = 5$(DEF_PGPORT)
+
# default encoding
MULTIBYTE = SQL_ASCII
@@ -130,7 +133,7 @@ all-spi:
check: all
-rm -rf ./testtablespace
mkdir ./testtablespace
- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT)
+ $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT)
installcheck: all
-rm -rf ./testtablespace
@@ -153,7 +156,7 @@ bigtest:
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql numeric_big
bigcheck:
- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) numeric_big
+ $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) numeric_big
##
diff --git a/src/test/regress/pg_regress.sh b/src/test/regress/pg_regress.sh
index 0ebb6621657..b68077fe9c6 100644
--- a/src/test/regress/pg_regress.sh
+++ b/src/test/regress/pg_regress.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.58 2005/06/25 23:04:06 tgl Exp $
+# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.59 2005/07/17 18:28:45 tgl Exp $
me=`basename $0`
: ${TMPDIR=/tmp}
@@ -27,6 +27,7 @@ Options:
Options for \`temp-install' mode:
--top-builddir=DIR (relative) path to top level build directory
+ --temp-port=PORT port number to start temp postmaster on
Options for using an existing installation:
--host=HOST use postmaster running on HOST
@@ -106,6 +107,7 @@ unset multibyte
dbname=regression
hostname=localhost
maxconnections=0
+temp_port=65432
load_langs=""
: ${GMAKE='@GMAKE@'}
@@ -160,6 +162,9 @@ do
--top-builddir=*)
top_builddir=`expr "x$1" : "x--top-builddir=\(.*\)"`
shift;;
+ --temp-port=*)
+ temp_port=`expr "x$1" : "x--temp-port=\(.*\)"`
+ shift;;
--host=*)
PGHOST=`expr "x$1" : "x--host=\(.*\)"`
export PGHOST
@@ -342,7 +347,13 @@ then
unset PGHOST
unset PGHOSTADDR
fi
- PGPORT=65432
+
+ # since Makefile isn't very bright, check for out-of-range temp_port
+ if [ "$temp_port" -ge 1024 -a "$temp_port" -le 65535 ] ; then
+ PGPORT=$temp_port
+ else
+ PGPORT=65432
+ fi
export PGPORT
# Get rid of environment stuff that might cause psql to misbehave