Skip to content

Commit d0f312e

Browse files
committed
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.
1 parent 59857b4 commit d0f312e

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

src/test/regress/GNUmakefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.49 2005/05/11 21:52:03 tgl Exp $
10+
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.50 2005/07/17 18:28:45 tgl Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -22,6 +22,9 @@ override CFLAGS += $(CFLAGS_SL)
2222

2323
SHLIB_LINK = $(BE_DLLLIBS)
2424

25+
# port number for temp-installation test postmaster
26+
TEMP_PORT = 5$(DEF_PGPORT)
27+
2528
# default encoding
2629
MULTIBYTE = SQL_ASCII
2730

@@ -130,7 +133,7 @@ all-spi:
130133
check: all
131134
-rm -rf ./testtablespace
132135
mkdir ./testtablespace
133-
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT)
136+
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT)
134137

135138
installcheck: all
136139
-rm -rf ./testtablespace
@@ -153,7 +156,7 @@ bigtest:
153156
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql numeric_big
154157

155158
bigcheck:
156-
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) numeric_big
159+
$(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
157160

158161

159162
##

src/test/regress/pg_regress.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.58 2005/06/25 23:04:06 tgl Exp $
2+
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.59 2005/07/17 18:28:45 tgl Exp $
33

44
me=`basename $0`
55
: ${TMPDIR=/tmp}
@@ -27,6 +27,7 @@ Options:
2727
2828
Options for \`temp-install' mode:
2929
--top-builddir=DIR (relative) path to top level build directory
30+
--temp-port=PORT port number to start temp postmaster on
3031
3132
Options for using an existing installation:
3233
--host=HOST use postmaster running on HOST
@@ -106,6 +107,7 @@ unset multibyte
106107
dbname=regression
107108
hostname=localhost
108109
maxconnections=0
110+
temp_port=65432
109111
load_langs=""
110112

111113
: ${GMAKE='@GMAKE@'}
@@ -160,6 +162,9 @@ do
160162
--top-builddir=*)
161163
top_builddir=`expr "x$1" : "x--top-builddir=\(.*\)"`
162164
shift;;
165+
--temp-port=*)
166+
temp_port=`expr "x$1" : "x--temp-port=\(.*\)"`
167+
shift;;
163168
--host=*)
164169
PGHOST=`expr "x$1" : "x--host=\(.*\)"`
165170
export PGHOST
@@ -342,7 +347,13 @@ then
342347
unset PGHOST
343348
unset PGHOSTADDR
344349
fi
345-
PGPORT=65432
350+
351+
# since Makefile isn't very bright, check for out-of-range temp_port
352+
if [ "$temp_port" -ge 1024 -a "$temp_port" -le 65535 ] ; then
353+
PGPORT=$temp_port
354+
else
355+
PGPORT=65432
356+
fi
346357
export PGPORT
347358

348359
# Get rid of environment stuff that might cause psql to misbehave

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy