Created
December 19, 2010 12:06
-
-
Save yaotti/747289 to your computer and use it in GitHub Desktop.
Print the result of last tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Cwd; | |
use YAML::Any; | |
use Term::ANSIColor; | |
my $prove_file = Cwd::getcwd() . "/.prove"; | |
if (-f $prove_file) { | |
my $test_results = YAML::Any::LoadFile($prove_file)->{tests}; | |
my $failed_tests = []; | |
for my $file (keys %$test_results) { | |
push @$failed_tests, $file if $test_results->{$file}->{last_result} > 0; | |
} | |
if (@$failed_tests) { | |
print colored 'NG: ', 'red'; | |
print join ", ", map { sprintf "%s", $_ } @$failed_tests; | |
}else { | |
print colored 'OK', 'green'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment