mesonbuild / mesonbuild/meson

`meson test --gdb` launches the wrapper with gdb instead of the wrappee test command

Open
#9,178 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

test targets
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

**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**

```meson
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the provided Meson project and compare `meson test _build --gdb` with the expected command invocation. Trace the `--gdb` handling for test setups with `exe_wrapper`; done means the wrapper runs before gdb and gdb receives `/bin/true` as the test command.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, cli, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.