Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a mean to pass arguments to the embedded Command #19

Open
lu-zero opened this issue Aug 24, 2022 · 2 comments
Open

Add a mean to pass arguments to the embedded Command #19

lu-zero opened this issue Aug 24, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lu-zero
Copy link

lu-zero commented Aug 24, 2022

This would make much simpler to pass arguments to tests.

@Hywan
Copy link
Owner

Hywan commented Aug 31, 2022

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:

  1. Use environment variables to pass values from Rust to C,
  2. 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?

@Hywan Hywan self-assigned this Aug 31, 2022
@Hywan Hywan added the enhancement New feature or request label Aug 31, 2022
@lu-zero
Copy link
Author

lu-zero commented Aug 31, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants