Install TAP test infrastructure so it's available for extension testing.
authorTom Lane <[email protected]>
Fri, 23 Sep 2016 19:50:00 +0000 (15:50 -0400)
committerTom Lane <[email protected]>
Fri, 23 Sep 2016 19:50:00 +0000 (15:50 -0400)
When configured with --enable-tap-tests, "make install" will now install
the Perl support files for TAP testing where PGXS will find them.
This allows extensions to rely on $(prove_check) even when being built
out-of-tree.  Back-patch to 9.4 where we first started to support TAP
testing, to reduce the number of cases extension makefiles need to
consider.

Craig Ringer

Discussion: <CAMsr+YFXv+2qne6xJW7z_25mYBtktRX5rpkrgrb+DRgQ_FxgHQ@mail.gmail.com>

src/Makefile
src/test/Makefile
src/test/perl/Makefile [new file with mode: 0644]

index b526be798596b4da3472d0701ac2133600f4b059..977f80b469bd6553f9db0f3b3a4e254e687bcbbf 100644 (file)
@@ -26,7 +26,8 @@ SUBDIRS = \
    bin \
    pl \
    makefiles \
-   test/regress
+   test/regress \
+   test/perl
 
 # There are too many interdependencies between the subdirectories, so
 # don't attempt parallel make here.
index 7f7754f3ee9d8df3d5b0bbfd4d2c2a8dcd4e58e4..6b40cf50ed2eb0700d70ec5c3832658852469dab 100644 (file)
@@ -12,7 +12,7 @@ subdir = src/test
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
-SUBDIRS = regress isolation modules recovery
+SUBDIRS = perl regress isolation modules recovery
 
 # We don't build or execute examples/, locale/, or thread/ by default,
 # but we do want "make clean" etc to recurse into them.  Likewise for ssl/,
diff --git a/src/test/perl/Makefile b/src/test/perl/Makefile
new file mode 100644 (file)
index 0000000..8ab60fc
--- /dev/null
@@ -0,0 +1,33 @@
+#-------------------------------------------------------------------------
+#
+# Makefile for src/test/perl
+#
+# Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+# Portions Copyright (c) 1994, Regents of the University of California
+#
+# src/test/perl/Makefile
+#
+#-------------------------------------------------------------------------
+
+subdir = src/test/perl
+top_builddir = ../../..
+include $(top_builddir)/src/Makefile.global
+
+ifeq ($(enable_tap_tests),yes)
+
+installdirs:
+   $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
+
+install: all installdirs
+   $(INSTALL_DATA) $(srcdir)/TestLib.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/TestLib.pm'
+   $(INSTALL_DATA) $(srcdir)/SimpleTee.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/SimpleTee.pm'
+   $(INSTALL_DATA) $(srcdir)/RecursiveCopy.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/RecursiveCopy.pm'
+   $(INSTALL_DATA) $(srcdir)/PostgresNode.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresNode.pm'
+
+uninstall:
+   rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/TestLib.pm'
+   rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/SimpleTee.pm'
+   rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/RecursiveCopy.pm'
+   rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgresNode.pm'
+
+endif