Re: List TAP test files in makefiles

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: List TAP test files in makefiles
Date: 2025-11-02 20:35:44
Message-ID: CAN55FZ3wgq57tCTot=r0QYgi1VpMa3R_VSd1h3DPrXy_jTRwdw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, 28 Oct 2025 at 07:19, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> Another less invasive solution for the code tree would be to have
> meson cross-check that the list of files it defines matches with
> what's on disk. With the drop of Makefiles and ./configure at some
> point in mind, I am not convinced that the t/*.pl rule needs to
> change, but meson could be made more reliable by making sure that
> what's listed matches with what we have in the source tree. That
> would prevent a lot of mistakes.

I tried to implement this but it didn't quite work, please see details below.

I introduced a new test, meson_tap_test_check, in the meson build
system. This test runs first in the test suite and compares two file
sets:

1- Files on disk matching the t/*.pl wildcard.
2- The output of "meson introspect ${pg_root_dir} --tests" filtered
with the same t/*.pl wildcard.

The test subtracts the second list from the first and fails if there
is any difference.

However, this approach didn’t work because some tests are not
registered if their dependencies (or such) aren’t found. For example,
'001_sepgsql.pl' test isn't registered if the 'selinux' dependency is
missing and that causes a difference between #1 and #2. Given that, I
think it would be better if we register all tests and skip those whose
dependencies aren’t found, rather than not registering them when the
dependency isn’t found.

The attached patch shows what I implemented.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
Ensure-all-TAP-tests-are-registered-in-the-Meson-.patch text/x-patch 3.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-11-02 20:40:46 Re: proposal: schema variables
Previous Message Sami Imseih 2025-11-02 20:35:04 Re: Improve LWLock tranche name visibility across backends