Skip to content

Commit

Permalink
test: Add 'blessed (with warnings)' status (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysxia authored Mar 3, 2025
2 parents d1fa591 + 0a4dabe commit ddaeefd
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions tests/tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,25 +399,31 @@ where
}

if args.bless {
if !success {
erase_in_flight(out);
write!(out, "{}: ", entry.display()).unwrap();
out.set_color(ColorSpec::new().set_fg(Some(Color::Blue))).unwrap();
writeln!(out, "blessed").unwrap();
out.reset().unwrap();
}

if output.stdout.is_empty() {
let _ = std::fs::remove_file(stdout);
} else {
std::fs::write(stdout, &output.stdout).unwrap();
}

if output.stderr.is_empty() {
let no_warn = output.stderr.is_empty();
if no_warn {
let _ = std::fs::remove_file(stderr);
} else {
std::fs::write(stderr, &output.stderr).unwrap();
}

if !success {
erase_in_flight(out);
write!(out, "{}: ", entry.display()).unwrap();
if no_warn {
out.set_color(ColorSpec::new().set_fg(Some(Color::Blue))).unwrap();
writeln!(out, "blessed").unwrap();
} else {
out.set_color(ColorSpec::new().set_fg(Some(Color::Magenta))).unwrap();
writeln!(out, "blessed (with warnings)").unwrap();
}
out.reset().unwrap();
}
} else {
if !success {
erase_in_flight(out);
Expand Down

0 comments on commit ddaeefd

Please sign in to comment.