Skip to content

Build or rebuild binary target when tests are run #11550

Answered by eli-schwartz
andy5995 asked this question in Q&A
Discussion options

You must be logged in to vote

Pretty sure what you want here is depends: main_bin, see https://mesonbuild.com/Reference-manual_functions.html#test

specifies that this test depends on the specified target(s), even though it does not take any of them as a command line argument. This is meant for cases where test finds those targets internally, e.g. plugins or globbing.

By adding a test that executes main_bin without args and expects it to return success, all you do is make the entire test suite depend on that bin before running any tests, but depends: does the same job except better -- it also works when you run

meson test single_test_name

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@andy5995
Comment options

Answer selected by andy5995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants