On Tue, Sep 04, 2018 at 03:16:55PM -0400, Tom Lane wrote: > Why would we invent a different target name? I was thinking something > roughly like > > check: submake $(REGRESS_PREP) > ifdef REGRESS > $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS) > endif > ifdef TAP_TESTS > $(prove_check) > endif > > although getting it to print a useful response when neither symbol > is set would require complicating things a bit. Still, as long as > there's just one copy of this rule, messiness isn't a big problem.
OK. I have dug into that, and finished with the attached. What do you think? One thing is that the definition of submake is moving out of REGRESS, and .PHONY gets defined. -- Michael
diff --git a/contrib/oid2name/Makefile b/contrib/oid2name/Makefile
index 908e078714..361a80a7a1 100644
--- a/contrib/oid2name/Makefile
+++ b/contrib/oid2name/Makefile
@@ -6,11 +6,11 @@ PGAPPICON = win32
PROGRAM = oid2name
OBJS = oid2name.o $(WIN32RES)
+TAP_TESTS = 1
+
PG_CPPFLAGS = -I$(libpq_srcdir)
PG_LIBS_INTERNAL = $(libpq_pgport)
-EXTRA_CLEAN = tmp_check
-
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -21,9 +21,3 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
-
-check:
- $(prove_check)
-
-installcheck:
- $(prove_installcheck)
diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile
index 5de506151e..3efcb46735 100644
--- a/contrib/vacuumlo/Makefile
+++ b/contrib/vacuumlo/Makefile
@@ -6,11 +6,11 @@ PGAPPICON = win32
PROGRAM = vacuumlo
OBJS = vacuumlo.o $(WIN32RES)
+TAP_TESTS = 1
+
PG_CPPFLAGS = -I$(libpq_srcdir)
PG_LIBS_INTERNAL = $(libpq_pgport)
-EXTRA_CLEAN = tmp_check
-
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -21,9 +21,3 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
-
-check:
- $(prove_check)
-
-installcheck:
- $(prove_installcheck)
diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index d5731621e7..4759d09823 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -1283,6 +1283,15 @@ include $(PGXS)
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>TAP_TESTS</varname></term>
+ <listitem>
+ <para>
+ switch defining if TAP tests need to be run
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>NO_INSTALLCHECK</varname></term>
<listitem>
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 8deb356958..453b117dc5 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -44,6 +44,7 @@
# listed in MODULES or MODULE_big
# REGRESS -- list of regression test cases (without suffix)
# REGRESS_OPTS -- additional switches to pass to pg_regress
+# TAP_TESTS -- switch to enable TAP tests
# NO_INSTALLCHECK -- don't define an installcheck target, useful e.g. if
# tests require special configuration, or don't use pg_regress
# EXTRA_CLEAN -- extra files to remove in 'make clean'
@@ -305,6 +306,9 @@ ifeq ($(PORTNAME), win)
rm -f regress.def
endif
endif # REGRESS
+ifdef TAP_TESTS
+ rm -rf tmp_check/
+endif
ifdef MODULE_big
clean: clean-lib
@@ -339,6 +343,7 @@ $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
$(MKDIR_P) $(dir $@)
ln -s $< $@
endif # VPATH
+endif # REGRESS
.PHONY: submake
submake:
@@ -346,21 +351,32 @@ ifndef PGXS
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
endif
-# against installed postmaster
+# Standard rules to run regression tests including multiple test suites.
+# Runs against an installed postmaster
ifndef NO_INSTALLCHECK
installcheck: submake $(REGRESS_PREP)
+ifdef REGRESS
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
endif
+ifdef TAP_TESTS
+ $(prove_installcheck)
+endif
+endif # NO_INSTALLCHECK
+# Runs independently of any installation
ifdef PGXS
check:
@echo '"$(MAKE) check" is not supported.'
@echo 'Do "$(MAKE) install", then "$(MAKE) installcheck" instead.'
else
check: submake $(REGRESS_PREP)
+ifdef REGRESS
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
endif
-endif # REGRESS
+ifdef TAP_TESTS
+ $(prove_check)
+endif
+endif # PGXS
ifndef NO_TEMP_INSTALL
temp-install: EXTRA_INSTALL+=$(subdir)
diff --git a/src/test/modules/test_pg_dump/Makefile b/src/test/modules/test_pg_dump/Makefile
index c64b353707..6123b994f6 100644
--- a/src/test/modules/test_pg_dump/Makefile
+++ b/src/test/modules/test_pg_dump/Makefile
@@ -7,6 +7,7 @@ EXTENSION = test_pg_dump
DATA = test_pg_dump--1.0.sql
REGRESS = test_pg_dump
+TAP_TESTS = 1
ifdef USE_PGXS
PG_CONFIG = pg_config
@@ -18,8 +19,3 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
-
-check: prove-check
-
-prove-check: | temp-install
- $(prove_check)
signature.asc
Description: PGP signature
