X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F10-suppressions.t;h=04484002bc242a3fb8ba3a573ca9d951313792a6;hb=dc74bb8dc22ffd44b893cab2f065948c03410d1a;hp=935dfbee5011d98d7388764c39b8c3f15766ae3b;hpb=8e236cf7f5ac06829edb65527fcdf12716ecd159;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/t/10-suppressions.t b/t/10-suppressions.t index 935dfbe..0448400 100644 --- a/t/10-suppressions.t +++ b/t/10-suppressions.t @@ -2,8 +2,9 @@ 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/; my $path = supp_path(); @@ -11,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; +}