`meson test --gdb` launches the wrapper with gdb instead of the wrappee test command
Describe the bug
Using test wrappers will make --gdb option not to work, unless the wrapper is a binary itself, but is generally not expected to be tested, while we care about the wrappee.
To Reproduce
project('foo')
add_test_setup('default',
is_default: true,
exe_wrapper: find_program('env'),
)
test('true', find_program('true'))
Expected behavior
meson test _build --gdb will launch:
/usr/bin/env gdb --quiet --nh --args /bin/true
While it's currently launching: gdb --quiet --nh --args /usr/bin/env /bin/true.
It may probably be even added addressed by using another command-line option (like --gdb-test-only) if we don't want to break the previous behavior, but personally I find that using wrappers is breaking hardly the ability to use debuggers with tests.
I have a custom test-runner script and this would beneficial because currently I have to set follow-fork-mode child to debug my stuff. https://github.com/hse-project/hse/blob/master/tests/test-runner
Yeah set follow-fork-mode child may work, but not if you're using a script with sh-bang comment as the test executable, as gdb won't recognize it as a binary file, the only way would be to explicitly set the test binary as bash, python3 and friends and the script itself as argument.
That is the exact problem I have faced recently.