Skip to content

Commit 1e026c6

Browse files
committed
Fix issue ' cargo t --doc does not respect --color when a compilation error occurs #14403 '
1 parent 9a52bf5 commit 1e026c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cargo/ops/cargo_test.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ fn run_doc_tests(
214214
gctx.shell().status("Doc-tests", unit.target.name())?;
215215
let mut p = compilation.rustdoc_process(unit, *script_meta)?;
216216

217+
let color_arg = match color {
218+
ColorChoice::Always => "always",
219+
ColorChoice::Never => "never",
220+
ColorChoice::CargoAuto => "auto",
221+
};
222+
p.arg("--color").arg(color_arg);
223+
217224
for (var, value) in env {
218225
p.env(var, value);
219226
}

0 commit comments

Comments
 (0)