rust-diplomat / diplomat

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code
https://rust-diplomat.github.io/book/
Other
498 stars 46 forks source link

Macro tests should also ensure stuff compiles #617

Open Manishearth opened 1 month ago

Manishearth commented 1 month ago

I think instead of having insta tests in lib.rs, the macro should test things by having files in tests/, which get run with the macro, and also have atests/insta_runner.rs` that runs the test files through the macro and generates insta snapshots.

Manishearth commented 1 month ago

Actually, I think the best path forward is this:

I think this would be particularly useful for other people hacking on Diplomat, and of course makes it easier to review macro changes. So far we basically haven't touched the macro much, but I've also found myself afraid of touching the macro because I don't want to subtly break FFI. having more checked in generated stuff would greatly help.