Skip to content

Commit 77f8162

Browse files
committed
Colour code tests passing vs failing.
Use colour escape codes to colour code the [OK] vs [FAILED] output from `test.pl`.
1 parent 50d1c79 commit 77f8162

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

regression/test.pl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use strict;
55
use warnings;
66
use File::Basename;
7+
use Term::ANSIColor;
78

89
use Cwd;
910

@@ -358,10 +359,10 @@ ($)
358359
$skips++;
359360
print " [SKIPPED]\n";
360361
} elsif(0 == $failed_skipped) {
361-
print " [OK] in $runtime seconds\n";
362+
print " [" . colored("OK", "green") . "] in $runtime seconds\n";
362363
} else {
363364
$failures++;
364-
print " [FAILED]\n";
365+
print " [" . colored("FAILED", "red") . "]\n";
365366
}
366367
}
367368
}
@@ -393,9 +394,9 @@ ($)
393394
print "\n";
394395

395396
if($failures == 0) {
396-
print "All tests were successful";
397+
print colored("All tests were successful", "green");
397398
} else {
398-
print "Tests failed\n";
399+
print colored("Tests failed", "red") . "\n";
399400
print " $failures of $count " . (1==$count?"test":"tests") . " failed";
400401
}
401402
print ", $skips " . (1==$skips?"test":"tests") . " skipped" if($skips > 0);

0 commit comments

Comments
 (0)