I would like to use the fork() API to run test code under Valgrind (in order to get CPU instruction counts, to be used in https://docs.rs/bigoish). So target/test/mytest or whatever it is should become valgrind --tool=callgrind target/test/mytest etc..
So this requires adding args to the start, rather than the end.
The current API almost allows this, but the process_modifier() gets called after the Command is constructed, so it's too late to add a prefix to command-line arguments. And e.g. making a new Command and replacing the passed in one with the new one doesn't work either because there's no way to access the temporary file so it's not possible to set it.
I'm not sure how to add this in backwards compatible way; if you have any ideas I might be able to do a PR. Or you can decide this is too niche/annoying to implement, and I will copy/paste the relevant code.
I would like to use the
fork()API to run test code under Valgrind (in order to get CPU instruction counts, to be used in https://docs.rs/bigoish). Sotarget/test/mytestor whatever it is should becomevalgrind --tool=callgrind target/test/mytestetc..So this requires adding args to the start, rather than the end.
The current API almost allows this, but the
process_modifier()gets called after theCommandis constructed, so it's too late to add a prefix to command-line arguments. And e.g. making a newCommandand replacing the passed in one with the new one doesn't work either because there's no way to access the temporary file so it's not possible to set it.I'm not sure how to add this in backwards compatible way; if you have any ideas I might be able to do a PR. Or you can decide this is too niche/annoying to implement, and I will copy/paste the relevant code.