Skip to content

Commit

Permalink
show the piped message if any
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Dec 20, 2023
1 parent d22e708 commit 0903278
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fuzz/fuzz_targets/fuzz_common.rs
Expand Up @@ -293,12 +293,16 @@ pub fn run_gnu_cmd(
pub fn compare_result(
test_type: &str,
input: &str,
pipe_input: Option<&str>,
rust_result: &CommandResult,
gnu_result: &CommandResult,
fail_on_stderr_diff: bool,
) {
println!("Test Type: {}", test_type);
println!("Input: {}", input);
if let Some(pipe) = pipe_input {
println!("Pipe: {}", pipe);
}

let mut discrepancies = Vec::new();
let mut should_panic = false;
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_echo.rs
Expand Up @@ -78,6 +78,7 @@ fuzz_target!(|_data: &[u8]| {
compare_result(
"echo",
&format!("{:?}", &args[1..]),
None,
&rust_result,
&gnu_result,
true,
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_expr.rs
Expand Up @@ -86,6 +86,7 @@ fuzz_target!(|_data: &[u8]| {
compare_result(
"expr",
&format!("{:?}", &args[1..]),
None,
&rust_result,
&gnu_result,
false, // Set to true if you want to fail on stderr diff
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_printf.rs
Expand Up @@ -99,6 +99,7 @@ fuzz_target!(|_data: &[u8]| {
compare_result(
"printf",
&format!("{:?}", &args[1..]),
None,
&rust_result,
&gnu_result,
false, // Set to true if you want to fail on stderr diff
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_seq.rs
Expand Up @@ -67,6 +67,7 @@ fuzz_target!(|_data: &[u8]| {
compare_result(
"seq",
&format!("{:?}", &args[1..]),
None,
&rust_result,
&gnu_result,
false, // Set to true if you want to fail on stderr diff
Expand Down
1 change: 1 addition & 0 deletions fuzz/fuzz_targets/fuzz_test.rs
Expand Up @@ -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
Expand Down

0 comments on commit 0903278

Please sign in to comment.