]> granicus.if.org Git - postgresql/commitdiff
Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Aug 2011 19:16:23 +0000 (15:16 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Aug 2011 19:17:03 +0000 (15:17 -0400)
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.

contrib/sepgsql/Makefile
doc/src/sgml/extend.sgml
src/makefiles/pgxs.mk

index 536de2b2241bd507acddd771eafbcf3839992134..7fee218db9a45db46869ba4e75135bc1a1bf5d54 100644 (file)
@@ -4,7 +4,10 @@ MODULE_big = sepgsql
 OBJS = hooks.o selinux.o label.o dml.o \
        schema.o relation.o proc.o
 DATA_built = sepgsql.sql
+
 REGRESS = label dml misc
+REGRESS_OPTS = --launcher $(top_builddir)/contrib/sepgsql/launcher
+
 EXTRA_CLEAN = -r tmp *.pp sepgsql-regtest.if sepgsql-regtest.fc
 
 ifdef USE_PGXS
@@ -19,4 +22,3 @@ include $(top_srcdir)/contrib/contrib-global.mk
 endif
 
 SHLIB_LINK += -lselinux
-REGRESS_OPTS += --launcher $(top_builddir)/contrib/sepgsql/launcher
index ab538cb500867a9bc38805d8708d24bed6506204..35a5ae8fd424680ff4008a99e740f78951607bd1 100644 (file)
@@ -1049,6 +1049,15 @@ include $(PGXS)
       </listitem>
      </varlistentry>
 
+     <varlistentry>
+      <term><varname>REGRESS_OPTS</varname></term>
+      <listitem>
+       <para>
+        additional switches to pass to <application>pg_regress</>
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry>
       <term><varname>EXTRA_CLEAN</varname></term>
       <listitem>
index 05ed8416a9f9372ff4a4ddd4ccab4d402cfefeb0..8b089e7a761ca06a0b187bce7c6765a709eb3997 100644 (file)
@@ -38,6 +38,7 @@
 #   SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
 #     which need to be built first
 #   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'
 #   PG_CPPFLAGS -- will be added to CPPFLAGS
 #   PG_LIBS -- will be added to PROGRAM link line
@@ -225,10 +226,8 @@ distclean maintainer-clean: clean
 
 ifdef REGRESS
 
-# Calling makefile can set REGRESS_OPTS, but this is the default:
-ifndef REGRESS_OPTS
-REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB)
-endif
+# Select database to use for running the tests
+REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
 
 # where to find psql for running the tests
 PSQLDIR = $(bindir)