Re: [PATCH v3 0/5] meson: wire up support for benchmarks
On Tue, Apr 22, 2025 at 9:53 AM Patrick Steinhardt <ps@pks.im> wrote:
>
> On Tue, Apr 22, 2025 at 09:27:57AM +0200, Christian Couder wrote:
Show 14 quoted lines
> > In https://lore.kernel.org/git/CAP8UFD2jKwYzmc40knXY7k+FQabjZbGTqs9fowF=-0OqfNYp_w@mail.gmail.com/
> > I wrote:
> >
> > "I wonder what happens when we run `meson test -C build --benchmark`
> > but 'time' is not found."
> >
> > because I wasn't sure if it would just do nothing in that case which
> > might not be very user friendly.
>
> Ah, sorry, forgot to answer that question. What Meson does in that case
> is to print "No tests defined". We could help improve usability a bit by
> printing benchmarks as part of the auto-detected features after setup of
> the build directory has finished. That would make it more discoverable
> that benchmarks have been disabled.
I was more expecting something simple like:
if time.found()
...
else
error('Benchmarking requires the `time` command')
endifin the same way as in meson.build elsewhere we have things like:
if not msgfmt.found() and gettext_option.enabled()
error('Internationalization via libintl requires msgfmt')
endif