inline-c-rs
inline-c-rs copied to clipboard
Add a mean to pass arguments to the embedded Command
This would make much simpler to pass arguments to tests.
Thanks for the feature proposal.
The C code is a total blackbox from the Rust point of view.
I see 2 solutions to not violate this blackbox feature:
- Use environment variables to pass values from Rust to C,
- Pass values onto C's
main
function.
Whatever we go for, the values are going to be pretty simple, like integers, floats, strings, maybe booleans (but those don't exist in C), but probably not more, or not without difficulties and for sure unvoluntary edge cases.
Can you share to me your usecase please?
I'm porting to inline-c some tests that had been written using meson, passing arguments using https://doc.rust-lang.org/std/process/struct.Command.html#method.args and having access to https://doc.rust-lang.org/std/process/struct.Command.html#method.envs and friends would make it easier.
Pushing it further would be even better to have the run() machinery exposed, then I could keep the C code available for the users and just include!() it so it would be fed to the test runner.