On 7/15/2026 9:24 AM, Alex Bennée wrote:
> Pierrick Bouvier <[email protected]> writes:
> 
>> On 7/14/2026 2:53 AM, Alex Bennée wrote:
>>> Pierrick Bouvier <[email protected]> writes:
>>>
>>>> This series replaces TCG tests makefiles with meson, with the
>>>> goal of having something more readable and maintainable in the long term.
>>>> Also it closes the gap that tcg tests had with the rest of tests, by 
>>>> integrating
>>>> them with meson directly.
>>>>
>>>> It covers all existing tests for all architectures, including
>>>> user/system/multiarch-user/multiarch-system. It implements all requirements
>>>> listed on original thread [1].
>>>>
>>>> [1] https://lore.kernel.org/qemu-devel/[email protected]/
>>>>
>>>> We also have for free:
>>>> - correct and complete dependencies for any test, including:
>>>>   scripts, c.inc, headers, reference files and binaries/plugins.
>>>> - catch test declaration issues at configure time vs test time.
>>>> - proper data types for variables instead of string expansion with make.
>>>>
>>>> Series first introduce the meson machinery needed in 
>>>> tests/tcg/meson.build, step
>>>> by step. Then it adds support for all existing archs. Finally, we remove
>>>> Makefiles and configure bits, and add documentation.
>>>>
>>>> Usage:
>>>>
>>>> ```
>>>> make check-tcg
>>>> make check-tcg-aarch64-linux-user
>>>> make check-tcg-aarch64-softmmu
>>>> make tcg-tests
>>>>
>>>> ninja tcg-tests
>>>
>>> This does work but I couldn't see tcg-tests (or individual tests) when
>>> running:
>>>
>>>   ninja -C . -t query all
>>>
>>> (which is what my Emacs's helper uses to query potential targets from
>>> ninja).
>>>
>>> The plugins, unit and qtest tests all appear in the list.
>>>
>>
>> This is because tcg tests are not built by default (so not included in
>> all), but they are under target tcg-tests.
>> Good news is that updating emacs config won't be too hard:
>> ninja -C build/ . -t query all tcg-tests
> 
> Thanks.
> 
> The helper is intending to be a generic introspection helper for
> multiple projects. Do you know if its possible to query for the list of
> groups(?) with ninja?
>

When you think about it twice, 'all' is just the default implicit
target. It's not generic, just a consequence of following original make
design.

If you consider the build graph, the really "generic" part are the roots
of it: nodes who are not dependencies of any other.

That's similar to what ninja -t targets, that you found, does. The only
difference is that its definition is targets producing outputs, instead
of just considering nodes in the graph. I don't think it matter too much
for your use case though.

https://ninja-build.org/manual.html#_extra_tools
```
targets
If used like ninja -t targets depth digit it prints the list of targets
in a depth-first manner starting by the root targets (the ones with no
outputs).
```
I'm just a bit puzzled that depth 1 (and not 0) is the default.

> I guess something like:
> 
>   ninja -t targets | grep phony
> 
> would work but I wonder if there is a better way?
>

More simply, you can stick to 'all' and assume that dependencies are now
correct, and that launching a test will automatically build what's needed.
That's the whole point of the series, that we don't need to "build"
tests or binaries by hand, or artificial make dependency, anymore. I
added the target tcg-tests for convenience, demonstration purpose, and
because people are used to do that, but it should not even exists to be
honest.

At this point, the "generic" part you really want to add in emacs is
which tests and suites are available. VSCode has this kind of feature
with Test Explorer:
https://code.visualstudio.com/docs/debugtest/testing.
- tests:
./pyvenv/bin/meson test --list | sed -e 's/.* - //'
- suites:
./pyvenv/bin/meson test --list |
sed -e 's/ - .*//' |
tr '+' '\n' |
sort -u
Regards,
Pierrick

Reply via email to