7 releases

0.2.9 Feb 12, 2023
0.2.8 Jan 31, 2023
0.2.6 Jun 12, 2022
0.2.5 Dec 18, 2021
0.2.3 Jul 3, 2021

#318 in Testing

Download history 135/week @ 2024-06-05 41/week @ 2024-06-12 604/week @ 2024-06-19 27/week @ 2024-06-26 6/week @ 2024-07-03 33/week @ 2024-07-10 35/week @ 2024-07-17 30/week @ 2024-07-24 43/week @ 2024-07-31 51/week @ 2024-08-07 53/week @ 2024-08-14 42/week @ 2024-08-21 78/week @ 2024-08-28 63/week @ 2024-09-04 64/week @ 2024-09-11 37/week @ 2024-09-18

249 downloads per month
Used in 11 crates

MIT/Apache

13KB
215 lines

exec-target

crate Docs Rust Version Apache2/MIT licensed Test ubu Test mac Test win

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.56.1 (59eed8a2a 2021-11-01)

Example

use exec_target::exec_target_with_env_in;

let command = "target/debug/exe-stab-grep";
let args = &["--color=always", "-e", "c"];
let envs = vec![("GREP_COLORS", "ms=01;32")];
let inp = b"abcdefg\n" as &[u8];

let oup = exec_target_with_env_in(command, args, envs, inp);

assert_eq!(oup.stderr, "");
assert_eq!(oup.stdout, "ab\u{1b}[01;32m\u{1b}[Kc\u{1b}[m\u{1b}[Kdefg\n");
assert_eq!(oup.status.success(), true);

Changelogs

This crate's changelog here.

License

This project is licensed under either of

at your option.

No runtime deps