Skip to content

Commit f669b61

Browse files
committed
Set shared library path for in-tree TAP tests
When the TAP tests are run in-tree (make check), set the shared library path using the appropriate environment variable, using a logic similar to pg_regress, so that the right libraries are used.
1 parent d34b48a commit f669b61

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Makefile.global.in

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,24 @@ PROVE = @PROVE@
300300
PG_PROVE_FLAGS = --ext='.pl' -I $(top_srcdir)/src/test/perl/
301301
PROVE_FLAGS = --verbose
302302

303+
# prepend to path if already set, else just set it
304+
define add_to_path
305+
$(1)='$(if $($(1)),$(2):$$$(1),$(2))'
306+
endef
307+
308+
# platform-specific environment variable to set shared library path
309+
define ld_library_path_var
310+
$(if $(filter $(PORTNAME),darwin),DYLD_LIBRARY_PATH,$(if $(filter $(PORTNAME),aix),LIBPATH,LD_LIBRARY_PATH))
311+
endef
312+
303313
define prove_installcheck
304314
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
305315
endef
306316

307317
define prove_check
308318
$(MKDIR_P) tmp_check/log
309319
$(MAKE) -C $(top_builddir) DESTDIR=$(CURDIR)/tmp_check/install install >$(CURDIR)/tmp_check/log/install.log 2>&1
310-
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
320+
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" $(call add_to_path,$(ld_library_path_var),$(CURDIR)/tmp_check/install$(libdir)) PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
311321
endef
312322

313323
# Installation.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy