From 847a783fc643e43a134090e0c70bec874c3ed1b7 Mon Sep 17 00:00:00 2001 From: sanchitlegalai <111577955+sanchitlegalai@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:02:05 +0530 Subject: [PATCH] Adding a note to hint --nocapture usage --- src/cargo/ops/cargo_test.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/cargo/ops/cargo_test.rs b/src/cargo/ops/cargo_test.rs index 86e830e76f05..34572022d114 100644 --- a/src/cargo/ops/cargo_test.rs +++ b/src/cargo/ops/cargo_test.rs @@ -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.", + )); }