Skip to content

test/meson: Add tests dependencies on built programs, libraries and modules

In current main, many tests we have have unresolved dependencies on tools and libraries that are included in glib but that we may not build when required. For example, just do:

meson /tmp/build
meson test -C /tmp/build -v spawn-path-search # errors happens also without parameters

And it would fail with:

[99/99] Linking target glib/tests/spawn-path-search
1/1 glib:glib / spawn-path-search        RUNNING       
>>> G_TEST_BUILDDIR=/tmp/build/glib/tests MALLOC_PERTURB_=75 MALLOC_CHECK_=2 G_TEST_SRCDIR=/home/user/app/glib/tests G_DEBUG=gc-friendly G_ENABLE_DIAGNOSTIC=1 /tmp/build/glib/tests/spawn-path-search

1/1 glib:glib / spawn-path-search        FAIL            0.24s   killed by signal 6 SIGABRT
―――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――
stdout:
# random seed: R02S57056913788e624d93696eb06d243ded
1..7
# Start of spawn tests
# /spawn/do-not-search summary: Without G_SPAWN_SEARCH_PATH, spawn-test-helper means ./spawn-test-helper.
Bail out! GLib:ERROR:../../home/user/app/glib/tests/spawn-path-search.c:75:test_do_not_search: assertion failed (error == NULL): Failed to execute child process ?/tmp/build/glib/tests/spawn-path-search-helper? (No such file or directory) (g-exec-error-quark, 8)
stderr:
**
GLib:ERROR:../../home/user/app/glib/tests/spawn-path-search.c:75:test_do_not_search: assertion failed (error == NULL): Failed to execute child process ?/tmp/build/glib/tests/spawn-path-search-helper? (No such file or directory) (g-exec-error-quark, 8)
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――


Summary of Failures:

1/1 glib:glib / spawn-path-search FAIL            0.24s   killed by signal 6 SIGABRT

More other failures like this are present (that one is just the quickest to trigger) because of missing tests dependencies on other targets.

This was mostly an unseen issue because in CI we were using -Dinstalled_tests=true that was making meson to force building (for later install) many test tools that test were depending, but races could have been still happened.

So, add missing test dependencies, using new extra properties to avoid meson ordering issues.

To make it better tested, remove the option on debian CI build (could be done also on fedora one, given we do installed tests CI's rounds on schedules) so that in case some test that we want to run depends on a tool that is not built, we can catch it.

/cc @xclaesse

Edited by Marco Trevisan

Merge request reports