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.
24 lines
529 B
24 lines
529 B
14 years ago
|
#!/usr/bin/perl
|
||
|
|
||
|
use warnings;
|
||
|
use strict;
|
||
|
|
||
|
# Usage:
|
||
|
# cov_check.pl <expected coverage percentage> <index.html to analyze>
|
||
|
|
||
|
|
||
|
my $min_cov = shift;
|
||
|
|
||
|
while (<>) {
|
||
|
if ( my ($cov) = /<td class="headerCovTableEntry\S+">(\d*\.\d*) %<\/td>/ ) {
|
||
|
if ($cov < $min_cov) {
|
||
|
print "The coverage: $cov% is NOT enough, it should be at least $min_cov%\n";
|
||
|
exit(1);
|
||
|
}
|
||
|
else {
|
||
|
print "The coverage: $cov% exceeds the expected $min_cov%, OK :)\n";
|
||
|
exit(0)
|
||
|
}
|
||
|
}
|
||
|
}
|