Skip to content

Commit

Permalink
Adding a note to hint --nocapture usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitlegalai authored and Sanchit Sahay committed Aug 4, 2024
1 parent fa64658 commit 847a783
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/cargo/ops/cargo_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,9 @@ fn report_test_error(
err = test_error.context(err);
}

crate::display_error(&err, &mut ws.gctx().shell());

let harness: bool = unit_err.unit.target.harness();
let nocapture: bool = test_args.contains(&"--nocapture");

if !is_simple && executed && harness && !nocapture {
drop(ws.gctx().shell().note(
"test exited abnormally; to see the full output pass --nocapture to the harness.",
));
}
crate::display_error(&err, &mut ws.config().shell());
drop(ws.config().shell().note(
"test was terminated by the signal, stderr might be truncated, \
pass `--nocapture` disable output buffering.",
));
}

0 comments on commit 847a783

Please sign in to comment.