Support multiple `--wrapper` commands in meson test
Describe the bug It may be useful to use wrappers in some situations, however they don't work well if another wrapper is already defined both via a test-setup or command line.
While using multiple wrappers can be useful
To Reproduce
project('foo')
add_test_setup('default',
is_default: true,
exe_wrapper: find_program('env'),
)
test('true', find_program('true'))
❯ meson test -C _build --wrap dbus-run-session
ninja: Entering directory `/data/GNOME/mutter/tst/_build'
ninja: no work to do.
Conflict: both test setup and command line specify an exe wrapper.
Expected behavior
Imho it wouldn't be a conflict, if each --wrapper call would specify a further wrapper so that the order will be:
in case of calling: meson test --wrap wrapper1 --wrap wrapper2 --wrap wrapper3:
wrapper1 wrapper2 wrapper3 [test-setup-wrapper] test-command
As per this, would be quite nice to have the ability to define wrappers per each test (as per #9180) so that #9178 will be addressed there.
Tagging along to this, I've found that the existing add_test_setup('some_name', ...) method of introducing an exe_wrapper: [] only works if the test setup is declared as is_default: true. If I have a single test setup with the default flag set and exe_wrapper defined, that wrapper is the only one that ever applies even to tests configured like, test (..., suite: 'some_non_default_suite'). I suspect this is related to this and the 3 issues you've also identified. Similarly, if I have two suites defined, both not as default: true but each having an exe_wrapper, it's as if the wrapper pointed to by the test(..., suite: <name>) is not even taken into consideration.