From: Vincent Pit Date: Sun, 28 Sep 2008 00:54:53 +0000 (+0200) Subject: Get infos from the suppression files in t/10-suppressions.t, so that we get useful... X-Git-Tag: v0.07~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=cbcfbd4cf52c82c81817773ec9dbca8a02b41052;p=perl%2Fmodules%2FTest-Valgrind.git Get infos from the suppression files in t/10-suppressions.t, so that we get useful feedback from smokers --- diff --git a/t/10-suppressions.t b/t/10-suppressions.t index ca9db49..0448400 100644 --- a/t/10-suppressions.t +++ b/t/10-suppressions.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 3; use lib qw{blib/archpub}; use Test::Valgrind::Suppressions qw/supp_path VG_PATH/; @@ -12,3 +12,25 @@ like($path, qr!Test/Valgrind/perlTestValgrind\.supp$!, 'supppath() returns the path to the suppression file'); isnt(VG_PATH, undef, 'VG_PATH is defined'); + +if (not open my $supp, '<', $path) { + fail("Couldn't open the suppression file at $path: $!"); +} else { + pass("Could open the suppression file"); + my ($in, $count, $true, $line) = (0, 0, 0, 0); + while (<$supp>) { + ++$line; + chomp; + s/^\s*//; + s/\s*$//; + if (!$in && $_ eq '{') { + $in = $line; + } elsif ($in && $_ eq '}') { + ++$count; + ++$true if $line - $in >= 2; + $in = 0; + } + } + diag "$count suppressions, of which $true are not empty"; + close $supp; +}