Re: Explicitly skip TAP tests under Meson if disabled

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Explicitly skip TAP tests under Meson if disabled
Date: 2023-11-04 00:51:05
Message-ID: 20231104005105.d5qteau62l4whz6k@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-10-30 05:45:52 -0400, Peter Eisentraut wrote:
> Under Meson, it is not very easy to see if TAP tests have been enabled or
> disabled, if you rely on the default auto setting. You either need to
> carefully study the meson setup output, or you notice, what a minute, didn't
> there use to be like 250 tests, not only 80?
>
> I think it would be better if we still registered the TAP tests in Meson
> even if the tap_tests option is disabled, but with a dummy command that
> registers them as skipped. That way you get a more informative output like

Hm, ok. I've never felt I needed this, but I can see the point.

> See attached patch for a possible implementation. (This uses perl as a hard
> build requirement. We are planning to do that anyway, but obviously other
> implementations, such as using python, would also be possible.)

There's already other hard dependencies on perl in the meson build (generating
kwlist etc). We certainly error out if it's not available.

>
> - test(test_dir['name'] / onetap_p,
> - python,
> - kwargs: test_kwargs,
> - args: testwrap_base + [
> - '--testgroup', test_dir['name'],
> - '--testname', onetap_p,
> - '--', test_command,
> - test_dir['sd'] / onetap,
> - ],
> - )
> + if tap_tests_enabled
> + test(test_dir['name'] / onetap_p,
> + python,
> + kwargs: test_kwargs,
> + args: testwrap_base + [
> + '--testgroup', test_dir['name'],
> + '--testname', onetap_p,
> + '--', test_command,
> + test_dir['sd'] / onetap,
> + ],
> + )
> + else
> + test(test_dir['name'] / onetap_p,
> + perl,
> + args: ['-e', 'print "1..0 # Skipped: TAP tests not enabled"'],
> + kwargs: test_kwargs)
> + endif

I'd just use a single test() invocation here, and add an argument to testwrap
indicating that it should print out the skipped message. That way we a) don't
need two test() invocations, b) could still see the test name etc in the test
invocation.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-11-04 01:36:39 Re: Inconsistent use of "volatile" when accessing shared memory?
Previous Message Jeff Davis 2023-11-04 00:44:44 Re: Inconsistent use of "volatile" when accessing shared memory?