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.
This commit is contained in:
parent
d34b48a021
commit
f669b61476
@ -300,6 +300,16 @@ PROVE = @PROVE@
|
||||
PG_PROVE_FLAGS = --ext='.pl' -I $(top_srcdir)/src/test/perl/
|
||||
PROVE_FLAGS = --verbose
|
||||
|
||||
# prepend to path if already set, else just set it
|
||||
define add_to_path
|
||||
$(1)='$(if $($(1)),$(2):$$$(1),$(2))'
|
||||
endef
|
||||
|
||||
# platform-specific environment variable to set shared library path
|
||||
define ld_library_path_var
|
||||
$(if $(filter $(PORTNAME),darwin),DYLD_LIBRARY_PATH,$(if $(filter $(PORTNAME),aix),LIBPATH,LD_LIBRARY_PATH))
|
||||
endef
|
||||
|
||||
define prove_installcheck
|
||||
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
|
||||
endef
|
||||
@ -307,7 +317,7 @@ endef
|
||||
define prove_check
|
||||
$(MKDIR_P) tmp_check/log
|
||||
$(MAKE) -C $(top_builddir) DESTDIR=$(CURDIR)/tmp_check/install install >$(CURDIR)/tmp_check/log/install.log 2>&1
|
||||
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
|
||||
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)
|
||||
endef
|
||||
|
||||
# Installation.
|
||||
|
Loading…
x
Reference in New Issue
Block a user