From 77f81621f4060efe1da77672f4a441fd3a222ca3 Mon Sep 17 00:00:00 2001 From: Thomas Spriggs Date: Thu, 24 May 2018 11:00:01 +0100 Subject: [PATCH] Colour code tests passing vs failing. Use colour escape codes to colour code the [OK] vs [FAILED] output from `test.pl`. --- regression/test.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/regression/test.pl b/regression/test.pl index d137e2dbb84..0cc10155e7c 100755 --- a/regression/test.pl +++ b/regression/test.pl @@ -4,6 +4,7 @@ use strict; use warnings; use File::Basename; +use Term::ANSIColor; use Cwd; @@ -358,10 +359,10 @@ ($) $skips++; print " [SKIPPED]\n"; } elsif(0 == $failed_skipped) { - print " [OK] in $runtime seconds\n"; + print " [" . colored("OK", "green") . "] in $runtime seconds\n"; } else { $failures++; - print " [FAILED]\n"; + print " [" . colored("FAILED", "red") . "]\n"; } } } @@ -393,9 +394,9 @@ ($) print "\n"; if($failures == 0) { - print "All tests were successful"; + print colored("All tests were successful", "green"); } else { - print "Tests failed\n"; + print colored("Tests failed", "red") . "\n"; print " $failures of $count " . (1==$count?"test":"tests") . " failed"; } print ", $skips " . (1==$skips?"test":"tests") . " skipped" if($skips > 0);