Function dfir_rs::util::run_cargo_example
source ยท pub fn run_cargo_example(
test_name: &str,
args: &str,
) -> (DroppableChild, ChildStdin, ChildStdout)
Expand description
Run a rust example as a test.
Rust examples are meant to be run by people and have a natural interface for that. This makes
unit testing them cumbersome. This function wraps calling cargo run and piping the stdin/stdout
of the example to easy to handle returned objects. The function also returns a DroppableChild
which will ensure that the child processes will be cleaned up appropriately.