#command #invoke

dev exec-target

the simple invoke command for test

4 releases

Uses new Rust 2021

0.2.6 Jun 12, 2022
0.2.5 Dec 18, 2021
0.2.4 Nov 14, 2021
0.2.3 Jul 3, 2021

#125 in Testing

Download history 77/week @ 2022-08-12 60/week @ 2022-08-19 40/week @ 2022-08-26 72/week @ 2022-09-02 86/week @ 2022-09-09 51/week @ 2022-09-16 69/week @ 2022-09-23 105/week @ 2022-09-30 95/week @ 2022-10-07 14/week @ 2022-10-14 53/week @ 2022-10-21 94/week @ 2022-10-28 119/week @ 2022-11-04 77/week @ 2022-11-11 72/week @ 2022-11-18 35/week @ 2022-11-25

323 downloads per month
Used in fewer than 11 crates

MIT/Apache

10KB
193 lines

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

Example

use exec_target::exec_target_with_env_in;

let command = "target/debug/exe-fake-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