Duke's utils
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
706 B

#!/usr/bin/perl -w
# Simple Perl test suite colorizer
# Jonathan Leto <jonathan@leto.net>
# Wed Feb 20 19:30:21 EST 2008
use strict;
use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;
# Example bash alias
# function t () {
# ./Build test --verbose 1 --test_files $1 |colortest
# }
while (<>){
if (/SKIP/) {
print YELLOW $_;
} elsif(/^ok/ || /Result: PASS/ || /All tests successful/){
print BOLD GREEN $_;
} elsif( /^not ok/ || /Dubious/ || /Result: FAIL/ || /Bad plan/ || /Failed/ || /Non-zero exit status/ ){
print BOLD RED $_;
} elsif( /^1\.\.\d+/ || m!^t/.+! ){
print BOLD BLUE $_;
} elsif (/^Files=/){
print BOLD MAGENTA $_;
} else {
print BOLD $_;
}
}