PXGS vs TAP tests

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-20T13:44:30Z
Lists: pgsql-hackers

Attachments

The recipe for running TAP tests in src/Makefile.global doesn't work for
the PGXS case. If you try it you get something like this:


andrew@emma:tests $ make PG_CONFIG=../inst.head.5701/bin/pg_config installcheck
rm -rf '/home/andrew/pgl/tests'/tmp_check
/usr/bin/mkdir -p '/home/andrew/pgl/tests'/tmp_check
cd ./ && TESTDIR='/home/andrew/pgl/tests' PATH="/home/andrew/pgl/inst.head.5701/bin:$PATH" PGPORT='65701' \
  top_builddir='/home/andrew/pgl/tests//home/andrew/pgl/inst.head.5701/lib/postgresql/pgxs/src/makefiles/../..' \
  PG_REGRESS='/home/andrew/pgl/tests//home/andrew/pgl/inst.head.5701/lib/postgresql/pgxs/src/makefiles/../../src/test/regress/pg_regress' \
  REGRESS_SHLIB='/src/test/regress/regress.so' \
  /usr/bin/prove -I /home/andrew/pgl/inst.head.5701/lib/postgresql/pgxs/src/makefiles/../../src/test/perl/ -I ./  t/*.pl


Notice those bogus settings for top_builddir, PG_REGRESS and
REGRESS_SHLIB. The attached patch fixes this bug. With it you can get by
with a Makefile as simple as this for running TAP tests under PGXS:

    TAP_TESTS = 1

    PG_CONFIG = pg_config
    PGXS := $(shell $(PG_CONFIG) --pgxs)
    include $(PGXS)


I removed the REGRESS_SHLIB setting altogether for the PGXS case - it's
not clear to me why we need it in a TAP test recipe at all. Certainly
it's not installed anywhere in a standard install so it seems entirely
bogus for the PGXS case.

This seems like a bug fix that should be patched all the way back,
although I haven't yet investigated the back branches.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Commits

  1. Fix prove_installcheck to use correct paths when used with PGXS