Re: Explicitly skip TAP tests under Meson if disabled

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Explicitly skip TAP tests under Meson if disabled
Дата
Msg-id 20231104005105.d5qteau62l4whz6k@awork3.anarazel.de
обсуждение исходный текст
Ответ на Explicitly skip TAP tests under Meson if disabled  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: Explicitly skip TAP tests under Meson if disabled  (Peter Eisentraut <peter@eisentraut.org>)
Re: Explicitly skip TAP tests under Meson if disabled  (Peter Eisentraut <peter@eisentraut.org>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Inconsistent use of "volatile" when accessing shared memory?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Inconsistent use of "volatile" when accessing shared memory?