Commit d1d38860 authored by Tom Lane's avatar Tom Lane

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.
parent 4803de6f
...@@ -4,8 +4,11 @@ MODULE_big = sepgsql ...@@ -4,8 +4,11 @@ MODULE_big = sepgsql
OBJS = hooks.o selinux.o label.o dml.o \ OBJS = hooks.o selinux.o label.o dml.o \
schema.o relation.o proc.o schema.o relation.o proc.o
DATA_built = sepgsql.sql DATA_built = sepgsql.sql
REGRESS = label dml misc REGRESS = label dml misc
REGRESS_PREP = check_selinux_environment REGRESS_PREP = check_selinux_environment
REGRESS_OPTS = --launcher $(top_builddir)/contrib/sepgsql/launcher
EXTRA_CLEAN = -r tmp *.pp sepgsql-regtest.if sepgsql-regtest.fc EXTRA_CLEAN = -r tmp *.pp sepgsql-regtest.if sepgsql-regtest.fc
ifdef USE_PGXS ifdef USE_PGXS
...@@ -20,7 +23,6 @@ include $(top_srcdir)/contrib/contrib-global.mk ...@@ -20,7 +23,6 @@ include $(top_srcdir)/contrib/contrib-global.mk
endif endif
SHLIB_LINK += -lselinux SHLIB_LINK += -lselinux
REGRESS_OPTS += --launcher $(top_builddir)/contrib/sepgsql/launcher
check_selinux_environment: check_selinux_environment:
@$(top_builddir)/contrib/sepgsql/chkselinuxenv "$(bindir)" "$(datadir)" @$(top_builddir)/contrib/sepgsql/chkselinuxenv "$(bindir)" "$(datadir)"
...@@ -1049,6 +1049,15 @@ include $(PGXS) ...@@ -1049,6 +1049,15 @@ include $(PGXS)
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>REGRESS_OPTS</varname></term>
<listitem>
<para>
additional switches to pass to <application>pg_regress</>
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><varname>EXTRA_CLEAN</varname></term> <term><varname>EXTRA_CLEAN</varname></term>
<listitem> <listitem>
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
# SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin, # SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
# which need to be built first # which need to be built first
# REGRESS -- list of regression test cases (without suffix) # REGRESS -- list of regression test cases (without suffix)
# REGRESS_OPTS -- additional switches to pass to pg_regress
# EXTRA_CLEAN -- extra files to remove in 'make clean' # EXTRA_CLEAN -- extra files to remove in 'make clean'
# PG_CPPFLAGS -- will be added to CPPFLAGS # PG_CPPFLAGS -- will be added to CPPFLAGS
# PG_LIBS -- will be added to PROGRAM link line # PG_LIBS -- will be added to PROGRAM link line
...@@ -225,10 +226,8 @@ distclean maintainer-clean: clean ...@@ -225,10 +226,8 @@ distclean maintainer-clean: clean
ifdef REGRESS ifdef REGRESS
# Calling makefile can set REGRESS_OPTS, but this is the default: # Select database to use for running the tests
ifndef REGRESS_OPTS REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB)
endif
# where to find psql for running the tests # where to find psql for running the tests
PSQLDIR = $(bindir) PSQLDIR = $(bindir)
......
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