On Wed, 2014-05-07 at 03:08 +0200, Andres Freund wrote: > > As an additional issue it currently doesn't seem to work in VPATH > > builds. That's imo a must fix. > > A "cd $(srcdir) && .." in prove_installcheck and prove_check seems to do > the trick.
Here is my proposed patch for this.
diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 14119a1..93be859 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -301,13 +301,13 @@ PG_PROVE_FLAGS = --ext='.pl' -I $(top_srcdir)/src/test/perl/ PROVE_FLAGS = --verbose define prove_installcheck -PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) +cd $(srcdir) && CURDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) 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 -PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) +cd $(srcdir) && CURDIR='$(CURDIR)' PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) endef # Installation. diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index 8a31110..78622fa 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -62,7 +62,7 @@ $ENV{PGPORT} = int($ENV{PGPORT}) % 65536; sub tempdir { - return File::Temp::tempdir('testXXXX', DIR => cwd(), CLEANUP => 1); + return File::Temp::tempdir('testXXXX', DIR => $ENV{CURDIR} || cwd(), CLEANUP => 1); } my ($test_server_datadir, $test_server_logfile);
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers