Skip to content

Commit 9a0aa9c

Browse files
author
Thomas Kiley
authored
Merge pull request diffblue#2235 from thomasspriggs/test-pl-colour
Colour code tests passing vs failing.
2 parents 8befd02 + 77f8162 commit 9a0aa9c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

regression/test.pl

+5-4
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

@@ -373,10 +374,10 @@ ($)
373374
$skips++;
374375
print " [SKIPPED]\n";
375376
} elsif(0 == $failed_skipped) {
376-
print " [OK] in $runtime seconds\n";
377+
print " [" . colored("OK", "green") . "] in $runtime seconds\n";
377378
} else {
378379
$failures++;
379-
print " [FAILED]\n";
380+
print " [" . colored("FAILED", "red") . "]\n";
380381
}
381382
}
382383
}
@@ -408,9 +409,9 @@ ($)
408409
print "\n";
409410

410411
if($failures == 0) {
411-
print "All tests were successful";
412+
print colored("All tests were successful", "green");
412413
} else {
413-
print "Tests failed\n";
414+
print colored("Tests failed", "red") . "\n";
414415
print " $failures of $count " . (1==$count?"test":"tests") . " failed";
415416
}
416417
print ", $skips " . (1==$skips?"test":"tests") . " skipped" if($skips > 0);

0 commit comments

Comments
 (0)