summaryrefslogtreecommitdiff
path: root/src/makefiles
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2018-11-26 08:39:19 +0900
committerMichael Paquier <michael@paquier.xyz>2018-11-26 08:39:19 +0900
commit03faa4a8ddf04334850bf9631f305bda7a02f260 (patch)
tree842e1802ea78a45097bda4fa838b8df43c1ca730 /src/makefiles
parent2dedf4d9a899b36d1a8ed29be5efbd1b31a8fe85 (diff)
Add PGXS options to control TAP and isolation tests
The following options are added for extensions: - TAP_TESTS, to allow an extention to run TAP tests which are the ones present in t/*.pl. A subset of tests can always be run with the existing PROVE_TESTS for developers. - ISOLATION, to define a list of isolation tests. - ISOLATION_OPTS, to pass custom options to isolation_tester. A couple of custom Makefile targets have been accumulated across the tree to cover the lack of facility in PGXS for a couple of releases when using those test suites, which are all now replaced with the new flags, without reducing the test coverage. This also fixes an issue with contrib/bloom/, which had a custom target to trigger its TAP tests of its own not part of the main check runs. Author: Michael Paquier Reviewed-by: Adam Berlin, Álvaro Herrera, Tom Lane, Nikolay Shaplov, Arthur Zakirov Discussion: https://postgr.es/m/20180906014849.GG2726@paquier.xyz
Diffstat (limited to 'src/makefiles')
-rw-r--r--src/makefiles/pgxs.mk32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 070d151018b..e8fecaec0fe 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -46,6 +46,9 @@
# HEADERS_built_$(MODULE) -- as above but built first (also NOT cleaned)
# REGRESS -- list of regression test cases (without suffix)
# REGRESS_OPTS -- additional switches to pass to pg_regress
+# TAP_TESTS -- switch to enable TAP tests
+# ISOLATION -- list of isolation test cases
+# ISOLATION_OPTS -- additional switches to pass to pg_isolation_regress
# 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'
@@ -349,6 +352,12 @@ ifeq ($(PORTNAME), win)
rm -f regress.def
endif
endif # REGRESS
+ifdef TAP_TESTS
+ rm -rf tmp_check/
+endif
+ifdef ISOLATION
+ rm -rf output_iso/ tmp_check_iso/
+endif
ifdef MODULE_big
clean: clean-lib
@@ -383,28 +392,47 @@ $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
$(MKDIR_P) $(dir $@)
ln -s $< $@
endif # VPATH
+endif # REGRESS
.PHONY: submake
submake:
ifndef PGXS
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
+ $(MAKE) -C $(top_builddir)/src/test/isolation all
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 ISOLATION
+ $(pg_isolation_regress_installcheck) $(ISOLATION_OPTS) $(ISOLATION)
+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 ISOLATION
+ $(pg_isolation_regress_check) $(ISOLATION_OPTS) $(ISOLATION)
+endif
+ifdef TAP_TESTS
+ $(prove_check)
+endif
+endif # PGXS
ifndef NO_TEMP_INSTALL
temp-install: EXTRA_INSTALL+=$(subdir)