Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: Allow tests to be optional #692

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bbhtt
Copy link

@bbhtt bbhtt commented Jan 14, 2025

No description provided.

Comment on lines +68 to +72
option('tests',
description: 'Build the test suite',
type: 'boolean',
value: true
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are always optional, you never have to run them. What's the goal here? Just to avoid compiling the test programs by default?

I would suggest instead setting build_by_default: false for test progs. Meson 1.7 won't build them by default anymore, if you do so.

Copy link
Author

@bbhtt bbhtt Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

1.7 is too new for me to benefit from it and still only rc

@ximion
Copy link
Owner

ximion commented Feb 23, 2025

I think I will have to veto this. I always want the tests to be compiled - to at least have them build is the easiest way to find any issues early instead of shipping something broken onto systems which might then break in subtle ways.

Of course, people may not run the tests after build, but that risk is up to the people building the code ;-)

Is there any reason why you don't want to even build the tests? They are extremely quick to compile and quite lightweight.

@eli-schwartz
Copy link

TBH I'm not sure I understand the distinction. Distributors want to run tests after build too, obviously, as they don't like regressions either. But it's possible to toggle them off if e.g. you've already run it (or someone else has), and skipping them saves you on 24 compile jobs (8 tests times 2 sources + 1 link stage).

It may not be the biggest deal in the world, but it's not nothing.

Again, tagging them as build_by_default: false means they get compiled just-in-time for the test phase itself, no need to bother people with additional configure options and the tests are always enabled for anyone that tries running it. It's not clear to me that simply compiling the test programs provides valuable additional testsuite coverage...

@bbhtt
Copy link
Author

bbhtt commented Feb 24, 2025

I always want the tests to be compiled

That is what it is doing by default so I don't think it changes anything on your end other than having 2 extra options.

As you said anyone who turned them off when building will do so knowingly.

Having an option to not compile them by default saves some time, if you have to do repeated rebuilds from scratch of things where appstream is a dependency. It is not a very significant time saved right now but I think it is worth providing an option.

The other thing is installed-tests being installed which is being worked around eg. see https://gitlab.alpinelinux.org/alpine/aports/-/blob/4aa55390052999d340a4670a33538f1583f17dcb/community/appstream/APKBUILD#L69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants