Skip to content

Conversation

@thesamesam
Copy link
Member

@thesamesam thesamesam commented Nov 23, 2025

While adding some test coverage as a followup to some earlier changes, I found some other issues:

  • --executable wasn't (ever) behaving as desired;
  • some languages needed fixes like the others from yesterday.

@thesamesam thesamesam requested a review from jpakkane as a code owner November 23, 2025 20:23
@thesamesam thesamesam marked this pull request as draft November 23, 2025 20:50
@thesamesam thesamesam marked this pull request as ready for review November 23, 2025 21:33
@thesamesam thesamesam changed the title templates: test refactoring; fix --executable templates: fix --executable, source discovery for more langs, test refactoring Nov 23, 2025
Use `itertools.product()` to reduce an indentation level or two, though
we lose one again by changing to a function for fresh vs dirty.

I plan on adding more to these tests and it makes it a bit more manageable.

Best-viewed-with: --ignore-all-space
* In 1.7.1, the behaviour of --executable was to just ignore it.
* After my recent 9104bb6, the behaviour
  was that we'd require, for --executable xyz, xyz.c to exist or we'd
  fail to generate.

Neither are good! Instead, create the sample source file w/ the project
name, but call the executable whatever the user passed with `--executable`.

Bug: mesonbuild#15286
I missed this in 9104bb6 as we were only
testing whitelisted languages for source file discovery.

Tests now handle all of these by using the map we have in compilers, as
we need to know the suffix to use for the invalid source files we inject.

Note that for tests, we mix explicit --lang in some cases and not others,
which we could probably do better with. For these 'must fail' tests, I've
stuck with explicit `--lang` to make sure we're testing what we want,
but the others are perhaps up for debate.

Bug: mesonbuild#15286
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants