Skip to content

Commit d1d3886

Browse files
committed
Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS.
The previous coding resulted in contrib modules unintentionally overriding the use of CONTRIB_TESTDB. There seems no particularly good reason to allow that (after all, the makefile can set CONTRIB_TESTDB if that's really what it intends). In passing, document REGRESS_OPTS where the other pgxs.mk options are documented. Back-patch to 9.1 --- in prior versions, there were no cases of contrib modules setting REGRESS_OPTS without including the --dbname switch, so while the coding was fragile there was no actual bug.
1 parent 4803de6 commit d1d3886

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

contrib/sepgsql/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ MODULE_big = sepgsql
44
OBJS = hooks.o selinux.o label.o dml.o \
55
schema.o relation.o proc.o
66
DATA_built = sepgsql.sql
7+
78
REGRESS = label dml misc
89
REGRESS_PREP = check_selinux_environment
10+
REGRESS_OPTS = --launcher $(top_builddir)/contrib/sepgsql/launcher
11+
912
EXTRA_CLEAN = -r tmp *.pp sepgsql-regtest.if sepgsql-regtest.fc
1013

1114
ifdef USE_PGXS
@@ -20,7 +23,6 @@ include $(top_srcdir)/contrib/contrib-global.mk
2023
endif
2124

2225
SHLIB_LINK += -lselinux
23-
REGRESS_OPTS += --launcher $(top_builddir)/contrib/sepgsql/launcher
2426

2527
check_selinux_environment:
2628
@$(top_builddir)/contrib/sepgsql/chkselinuxenv "$(bindir)" "$(datadir)"

doc/src/sgml/extend.sgml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,15 @@ include $(PGXS)
10491049
</listitem>
10501050
</varlistentry>
10511051

1052+
<varlistentry>
1053+
<term><varname>REGRESS_OPTS</varname></term>
1054+
<listitem>
1055+
<para>
1056+
additional switches to pass to <application>pg_regress</>
1057+
</para>
1058+
</listitem>
1059+
</varlistentry>
1060+
10521061
<varlistentry>
10531062
<term><varname>EXTRA_CLEAN</varname></term>
10541063
<listitem>

src/makefiles/pgxs.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
3939
# which need to be built first
4040
# REGRESS -- list of regression test cases (without suffix)
41+
# REGRESS_OPTS -- additional switches to pass to pg_regress
4142
# EXTRA_CLEAN -- extra files to remove in 'make clean'
4243
# PG_CPPFLAGS -- will be added to CPPFLAGS
4344
# PG_LIBS -- will be added to PROGRAM link line
@@ -225,10 +226,8 @@ distclean maintainer-clean: clean
225226

226227
ifdef REGRESS
227228

228-
# Calling makefile can set REGRESS_OPTS, but this is the default:
229-
ifndef REGRESS_OPTS
230-
REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB)
231-
endif
229+
# Select database to use for running the tests
230+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
232231

233232
# where to find psql for running the tests
234233
PSQLDIR = $(bindir)

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