USE_MODULE_DB-all-v1.patch

text/plain

Filename: USE_MODULE_DB-all-v1.patch
Type: text/plain
Part: 0
Message: Extending USE_MODULE_DB to more test suite types

Patch

Format: unified
Series: patch v1
File+
src/Makefile.global.in 17 8
src/makefiles/pgxs.mk 5 6
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index c118f64..6b98d53 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -597,16 +597,25 @@ submake-libpgfeutils: | submake-generated-headers
 #
 # Testing support
 
-PL_TESTDB = pl_regression
-CONTRIB_TESTDB = contrib_regression
-ifneq ($(MODULE_big),)
-  CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
-else
-  ifneq ($(MODULES),)
-    CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
+ifneq ($(USE_MODULE_DB),)
+  PL_TESTDB = pl_regression_$(NAME)
+  # Replace this with $(or ...) if we ever require GNU make 3.81.
+  ifneq ($(MODULE_big),)
+    CONTRIB_TESTDB=contrib_regression_$(MODULE_big)
+    ISOLATION_TESTDB=isolation_regression_$(MODULE_big)
   else
-    CONTRIB_TESTDB_MODULE = contrib_regression
+    ifneq ($(MODULES),)
+      CONTRIB_TESTDB=contrib_regression_$(word 1,$(MODULES))
+      ISOLATION_TESTDB=isolation_regression_$(word 1,$(MODULES))
+    else
+      CONTRIB_TESTDB=contrib_regression_$(word 1,$(REGRESS))
+      ISOLATION_TESTDB=isolation_regression_$(word 1,$(ISOLATION))
+    endif
   endif
+else
+  PL_TESTDB = pl_regression
+  CONTRIB_TESTDB = contrib_regression
+  ISOLATION_TESTDB = isolation_regression
 endif
 
 ifdef NO_LOCALE
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 909a49f..271e7ea 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -380,12 +380,7 @@ distclean maintainer-clean: clean
 
 ifdef REGRESS
 
-# Select database to use for running the tests
-ifneq ($(USE_MODULE_DB),)
-  REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE)
-else
-  REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
-endif
+REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
 
 # When doing a VPATH build, must copy over the data files so that the
 # driver script can find them.  We have to use an absolute path for
@@ -413,6 +408,10 @@ ifndef PGXS
 	$(MAKE) -C $(top_builddir)/src/test/isolation all
 endif
 
+ifdef ISOLATION
+ISOLATION_OPTS += --dbname=$(ISOLATION_TESTDB)
+endif
+
 # Standard rules to run regression tests including multiple test suites.
 # Runs against an installed postmaster.
 ifndef NO_INSTALLCHECK