parent
1ec5fb1466
commit
9834554c17
@ -0,0 +1,23 @@
|
||||
#!/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)
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# usage:
|
||||
# leak_check.pl <log>
|
||||
|
||||
|
||||
my $leaks = 0;
|
||||
my $errors = 0;
|
||||
|
||||
while (<>) {
|
||||
if (/definitely lost: ([0-9,]+) bytes in ([0-9]+) blocks/) { $leaks = $2; }
|
||||
if (/ERROR SUMMARY: (\d+) errors from (\d+) contexts/) { $errors = $2;}
|
||||
}
|
||||
|
||||
if ($leaks) { print(sprintf("You have some leaks at %d places :/\n", $leaks)); }
|
||||
if ($errors) { print(sprintf("You have some memory corruptions at %d places :/\n", $errors)); }
|
||||
|
||||
if (0 == $leaks && 0 == $errors) {
|
||||
print "Valgrind result are ok :)\n";
|
||||
exit(0);
|
||||
}
|
||||
exit(1);
|
||||
|
Loading…
Reference in new issue