aboutsummaryrefslogtreecommitdiffstats
path: root/util/flashrom_tester/src/tester.rs
diff options
context:
space:
mode:
Diffstat (limited to 'util/flashrom_tester/src/tester.rs')
-rw-r--r--util/flashrom_tester/src/tester.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/util/flashrom_tester/src/tester.rs b/util/flashrom_tester/src/tester.rs
index 6ce3889e..323b5365 100644
--- a/util/flashrom_tester/src/tester.rs
+++ b/util/flashrom_tester/src/tester.rs
@@ -573,6 +573,11 @@ pub fn collate_all_test_runs(
) {
match format {
OutputFormat::Pretty => {
+ let color = if atty::is(atty::Stream::Stdout) {
+ types::COLOR
+ } else {
+ types::NOCOLOR
+ };
println!();
println!(" =============================");
println!(" ===== AVL qual RESULTS ====");
@@ -591,8 +596,8 @@ pub fn collate_all_test_runs(
if *result != TestConclusion::Pass {
println!(
" {} {}",
- style!(format!(" <+> {} test:", name), types::BOLD),
- style_dbg!(result, types::RED)
+ style!(format!(" <+> {} test:", name), color.bold, color),
+ style_dbg!(result, color.red, color)
);
match error {
None => {}
@@ -601,8 +606,8 @@ pub fn collate_all_test_runs(
} else {
println!(
" {} {}",
- style!(format!(" <+> {} test:", name), types::BOLD),
- style_dbg!(result, types::GREEN)
+ style!(format!(" <+> {} test:", name), color.bold, color),
+ style_dbg!(result, color.green, color)
);
}
}