Skip to content

Commit

Permalink
Fix issue ' cargo t --doc does not respect --color when a compilation…
Browse files Browse the repository at this point in the history
… error occurs rust-lang#14403 '
  • Loading branch information
ShashiSugrim committed Aug 19, 2024
1 parent 9a52bf5 commit 1e026c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cargo/ops/cargo_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ fn run_doc_tests(
gctx.shell().status("Doc-tests", unit.target.name())?;
let mut p = compilation.rustdoc_process(unit, *script_meta)?;

let color_arg = match color {
ColorChoice::Always => "always",
ColorChoice::Never => "never",
ColorChoice::CargoAuto => "auto",
};
p.arg("--color").arg(color_arg);

for (var, value) in env {
p.env(var, value);
}
Expand Down

0 comments on commit 1e026c6

Please sign in to comment.