1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

fuzz: add the capability to pipe info into fuzz (#5668)

* fuzz: add the capability to pipe info into fuzz

* address the comments

* show the piped message if any
This commit is contained in:
Sylvestre Ledru 2023-12-21 16:18:00 +01:00 committed by GitHub
parent 6510115d9e
commit 546201bd00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 31 deletions

View file

@ -184,9 +184,9 @@ fuzz_target!(|_data: &[u8]| {
args.push(OsString::from(generate_test_arg()));
}
let rust_result = generate_and_run_uumain(&args, uumain);
let rust_result = generate_and_run_uumain(&args, uumain, None);
let gnu_result = match run_gnu_cmd(CMD_PATH, &args[1..], false) {
let gnu_result = match run_gnu_cmd(CMD_PATH, &args[1..], false, None) {
Ok(result) => result,
Err(error_result) => {
eprintln!("Failed to run GNU command:");
@ -203,6 +203,7 @@ fuzz_target!(|_data: &[u8]| {
compare_result(
"test",
&format!("{:?}", &args[1..]),
None,
&rust_result,
&gnu_result,
false, // Set to true if you want to fail on stderr diff