pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Clean up after TAP tests in oid2name and vacuumlo.
Date: Tue, 4 Sep 2018 13:58:18 -0700
Message-ID: <20180904205818.GH20696@paquier.xyz> (raw)
In-Reply-To: <28056.1536088615@sss.pgh.pa.us>
References: <E1fxCgZ-0002aC-4C@gemulon.postgresql.org>
	<20180904172957.GC20696@paquier.xyz>
	<23385.1536082913@sss.pgh.pa.us>
	<20180904190321.GF20696@paquier.xyz>
	<28056.1536088615@sss.pgh.pa.us>

On Tue, Sep 04, 2018 at 03:16:55PM -0400, Tom Lane wrote:
> Why would we invent a different target name?  I was thinking something
> roughly like
> 
> check: submake $(REGRESS_PREP)
> ifdef REGRESS
> 	$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
> endif
> ifdef TAP_TESTS
> 	$(prove_check)
> endif
> 
> although getting it to print a useful response when neither symbol
> is set would require complicating things a bit.  Still, as long as
> there's just one copy of this rule, messiness isn't a big problem.

OK.  I have dug into that, and finished with the attached.  What do you
think?  One thing is that the definition of submake is moving out of
REGRESS, and .PHONY gets defined.
--
Michael

Attachments:

tap-pgxs.patch (text/x-diff, 4.2K) download diff --git a/contrib/oid2name/Makefile b/contrib/oid2name/Makefile index 908e078714..361a80a7a1 100644 --- a/contrib/oid2name/Makefile +++ b/contrib/oid2name/Makefile @@ -6,11 +6,11 @@ PGAPPICON = win32 PROGRAM = oid2name OBJS = oid2name.o $(WIN32RES) +TAP_TESTS = 1 + PG_CPPFLAGS = -I$(libpq_srcdir) PG_LIBS_INTERNAL = $(libpq_pgport) -EXTRA_CLEAN = tmp_check - ifdef USE_PGXS PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) @@ -21,9 +21,3 @@ top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif - -check: - $(prove_check) - -installcheck: - $(prove_installcheck) diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile index 5de506151e..3efcb46735 100644 --- a/contrib/vacuumlo/Makefile +++ b/contrib/vacuumlo/Makefile @@ -6,11 +6,11 @@ PGAPPICON = win32 PROGRAM = vacuumlo OBJS = vacuumlo.o $(WIN32RES) +TAP_TESTS = 1 + PG_CPPFLAGS = -I$(libpq_srcdir) PG_LIBS_INTERNAL = $(libpq_pgport) -EXTRA_CLEAN = tmp_check - ifdef USE_PGXS PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) @@ -21,9 +21,3 @@ top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif - -check: - $(prove_check) - -installcheck: - $(prove_installcheck) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index d5731621e7..4759d09823 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1283,6 +1283,15 @@ include $(PGXS) </listitem> </varlistentry> + <varlistentry> + <term><varname>TAP_TESTS</varname></term> + <listitem> + <para> + switch defining if TAP tests need to be run + </para> + </listitem> + </varlistentry> + <varlistentry> <term><varname>NO_INSTALLCHECK</varname></term> <listitem> diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index 8deb356958..453b117dc5 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -44,6 +44,7 @@ # listed in MODULES or MODULE_big # REGRESS -- list of regression test cases (without suffix) # REGRESS_OPTS -- additional switches to pass to pg_regress +# TAP_TESTS -- switch to enable TAP tests # NO_INSTALLCHECK -- don't define an installcheck target, useful e.g. if # tests require special configuration, or don't use pg_regress # EXTRA_CLEAN -- extra files to remove in 'make clean' @@ -305,6 +306,9 @@ ifeq ($(PORTNAME), win) rm -f regress.def endif endif # REGRESS +ifdef TAP_TESTS + rm -rf tmp_check/ +endif ifdef MODULE_big clean: clean-lib @@ -339,6 +343,7 @@ $(test_files_build): $(abs_builddir)/%: $(srcdir)/% $(MKDIR_P) $(dir $@) ln -s $< $@ endif # VPATH +endif # REGRESS .PHONY: submake submake: @@ -346,21 +351,32 @@ ifndef PGXS $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X) endif -# against installed postmaster +# Standard rules to run regression tests including multiple test suites. +# Runs against an installed postmaster ifndef NO_INSTALLCHECK installcheck: submake $(REGRESS_PREP) +ifdef REGRESS $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS) endif +ifdef TAP_TESTS + $(prove_installcheck) +endif +endif # NO_INSTALLCHECK +# Runs independently of any installation ifdef PGXS check: @echo '"$(MAKE) check" is not supported.' @echo 'Do "$(MAKE) install", then "$(MAKE) installcheck" instead.' else check: submake $(REGRESS_PREP) +ifdef REGRESS $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS) endif -endif # REGRESS +ifdef TAP_TESTS + $(prove_check) +endif +endif # PGXS ifndef NO_TEMP_INSTALL temp-install: EXTRA_INSTALL+=$(subdir) diff --git a/src/test/modules/test_pg_dump/Makefile b/src/test/modules/test_pg_dump/Makefile index c64b353707..6123b994f6 100644 --- a/src/test/modules/test_pg_dump/Makefile +++ b/src/test/modules/test_pg_dump/Makefile @@ -7,6 +7,7 @@ EXTENSION = test_pg_dump DATA = test_pg_dump--1.0.sql REGRESS = test_pg_dump +TAP_TESTS = 1 ifdef USE_PGXS PG_CONFIG = pg_config @@ -18,8 +19,3 @@ top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif - -check: prove-check - -prove-check: | temp-install - $(prove_check)
signature.asc (application/pgp-signature, 832B) download

view thread (12+ messages)  latest in thread

Message-ID: <20180904205818.GH20696@paquier.xyz>
Permalink:  ../20180904205818.GH20696@paquier.xyz/
Also on:    postgresql.org/message-id/20180904205818.GH20696@paquier.xyz

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Clean up after TAP tests in oid2name and vacuumlo.
  In-Reply-To: <20180904205818.GH20696@paquier.xyz>
  References: <E1fxCgZ-0002aC-4C@gemulon.postgresql.org> <20180904172957.GC20696@paquier.xyz> <23385.1536082913@sss.pgh.pa.us> <20180904190321.GF20696@paquier.xyz> <28056.1536088615@sss.pgh.pa.us> <20180904205818.GH20696@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox