exec-target
the simple invoke command for test
This invokes external a command and manipulates standard in out.
You can use std::process::Command more easily.
Features
- minimum support rustc 1.58.0 (02072b482 2022-01-11)
Reproducible Tests and Environment
To ensure reproducible test results across different environments, exec-target is opinionated about environment variables.
By default, it clears the environment and only inherits a minimal set of essential variables:
TERMTZPATHLD_LIBRARY_PATH
Additionally, it explicitly sets LANG=C to avoid localized output from commands (e.g., error messages in different languages), which would otherwise make string assertions fragile.
Example
use exec_target_with_env_in;
let command = "target/debug/exe-stab-grep";
let args = &;
let envs = vec!;
let inp = b"abcdefg\n" as &;
let oup = exec_target_with_env_in.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
Changelogs
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.