Skip to content

meson: mctpd_test is only required for mctpd-enabled builds #104

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jk-ozlabs
Copy link
Member

@jk-ozlabs jk-ozlabs commented Aug 1, 2025

If we're building without mctpd (ie, no libsystemd), then we won't have a mctpd_test variable defined, so meson will fail:

meson.build:156:18: ERROR: Unknown variable "mctpd_test".

This builds the test dependencies according to what is enabled instead.

We then make the test-set conditional on the configuration too, by splitting into separate pytest invocations for the three test scripts (which are currently auto-loaded by pytest).

Finally, we add a github workflow for the no-libsystemd case to check this in future.

Fixes: #102

@jk-ozlabs jk-ozlabs marked this pull request as draft August 4, 2025 04:59
@jk-ozlabs jk-ozlabs force-pushed the pr/meson-test-deps branch 2 times, most recently from 17cf054 to bdc5a9f Compare August 4, 2025 06:06
@jk-ozlabs jk-ozlabs marked this pull request as ready for review August 4, 2025 06:10
If we're building without mctpd (ie, no libsystemd), then we won't have
a mctpd_test variable defined, so meson will fail:

    meson.build:156:18: ERROR: Unknown variable "mctpd_test".

This builds the test dependencies according to what is enabled instead.

Fixes: CodeConstruct#102
Signed-off-by: Jeremy Kerr <[email protected]>
Shorten the PYTEST_FLAGS var name to keep the one-line script a little
more manageable, no need for an export, and re-wrap.

Signed-off-by: Jeremy Kerr <[email protected]>
We currently have one pytest invocation (through one meson test()) which
runs all of the tests/test_*.py scripts.

However, not all of those will be testable in any particular
configuration. We may be building without libsystemd, in which case the
test_mctpd.py and test_mctpd_endpoint.py tests will not work.

So, define individual test() calls for each of the scripts. This also
lets us modify the runtime environment (the mctp-only tests don't
require dbus-run-session), and meson can parallelise too.

Signed-off-by: Jeremy Kerr <[email protected]>
Add a build without libsystemd present, so we can catch any issues that
arise from the non-mctpd build.

Enable verbose test output while we're at it.

Signed-off-by: Jeremy Kerr <[email protected]>
@jk-ozlabs jk-ozlabs force-pushed the pr/meson-test-deps branch from bdc5a9f to cc4b416 Compare August 5, 2025 01:35
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.

Can't build without libsystemd due to Unknown variable "mctpd_test".
1 participant