bacon
bacon copied to clipboard
Show color in doc test results
Bacon doesn't appear to colorize test failures in doc tests:
Given the following Error code (intentionally created):
/// # Examples
///
/// ```
/// # use ratatui::{prelude::*, buffer::Cell, layout::Position};
/// let buf = Buffer::empty(Rect::new(0, 0, 10, 10));
/// let cell = buf[(0, 0)];
/// let cell = &buf[Position::new(0, 0)];
/// ```
Cargo test --doc buffer/buffer output:
Bacon config:
[jobs.test]
command = [
"cargo", "test",
"--all-features",
"--color", "always",
"--", "--color", "always", # see https://github.com/Canop/bacon/issues/124
]
need_stdout = true
Bacon output:
It looks like cargo test doesn't respect the --color always argument. This might be a regression in cargo test (but it's also possible this was always the case, cargo test is a weird complicated construct).
I'm seeing --color always as working for cargo test.
cargo test &> tmp.txt--> no colorcargo test --color always &> tmp2.txt--> color
version: cargo 1.93.0-nightly (445fe4a68 2025-11-07)
Possibly related upstream discussion: https://github.com/rust-lang/cargo/issues/1983
Hum. Unless I miss something, it does look like colors are back in cargo test output...
(I'm quite sure I'm missing something, in fact, as I get colors also with a cargo +1.60 test)