On 7/4/25 12:26, Manos Pitsidianakis wrote:
We don't currently test our proc macros and it'd be nice to do so.

Usually this would be done with something like
https://crates.io/crates/trybuild which runs cargo and tries to compile
a test input, and checks for success/failure. However we cannot use it
with meson directly, plus it would drag in a lot of dependencies anyway.

Instead of compiling, we can easily just expand test input into token
streams since we already split macro implementation into separate
functions, allowing us to either get a TokenStream back or a compile
error message.

You can run the added tests directly with this meson command:

   meson test rust-qemu-api-macros-tests

Signed-off-by: Manos Pitsidianakis <[email protected]>

Nice.  Adjusted for MacroError removal and applied, thanks.

Paolo


Reply via email to