Skip to content

Commit a0fc813

Browse files
committed
Fix prove_installcheck to use correct paths when used with PGXS
The prove_installcheck recipe in src/Makefile.global.in was emitting bogus paths for a couple of elements when used with PGXS. Here we create a separate recipe for the PGXS case that does it correctly. We also take the opportunity to make the make the file more readable by breaking up the prove_installcheck and prove_check recipes across several lines, and to remove the setting for REGRESS_SHLIB to src/test/recovery/Makefile, which is the only set of tests that actually need it. Backpatch to all live branches Discussion: https://postgr.es/m/f2401388-936b-f4ef-a07c-a0bcc49b3300@dunslane.net
1 parent c8bf509 commit a0fc813

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/Makefile.global.in

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,16 +444,35 @@ with_temp_install = \
444444

445445
ifeq ($(enable_tap_tests),yes)
446446

447+
ifndef PGXS
447448
define prove_installcheck
448449
rm -rf '$(CURDIR)'/tmp_check
449450
$(MKDIR_P) '$(CURDIR)'/tmp_check
450-
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' REGRESS_SHLIB='$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
451+
cd $(srcdir) && \
452+
TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' \
453+
top_builddir='$(CURDIR)/$(top_builddir)' \
454+
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
455+
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
451456
endef
457+
else # PGXS case
458+
define prove_installcheck
459+
rm -rf '$(CURDIR)'/tmp_check
460+
$(MKDIR_P) '$(CURDIR)'/tmp_check
461+
cd $(srcdir) && \
462+
TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' \
463+
top_builddir='$(top_builddir)' \
464+
PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' \
465+
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
466+
endef
467+
endif # PGXS
452468

453469
define prove_check
454470
rm -rf '$(CURDIR)'/tmp_check
455471
$(MKDIR_P) '$(CURDIR)'/tmp_check
456-
cd $(srcdir) && TESTDIR='$(CURDIR)' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' REGRESS_SHLIB='$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
472+
cd $(srcdir) && \
473+
TESTDIR='$(CURDIR)' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' \
474+
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
475+
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
457476
endef
458477

459478
else

src/test/recovery/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ subdir = src/test/recovery
1515
top_builddir = ../../..
1616
include $(top_builddir)/src/Makefile.global
1717

18+
# required for 017_shm.pl
19+
REGRESS_SHLIB=$(abs_top_builddir)/src/test/regress/regress$(DLSUFFIX)
20+
export REGRESS_SHLIB
21+
1822
check:
1923
$(prove_check)
2024

0 commit comments

Comments
 (0)