X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FSuppressions.pm;h=1226aab89d4e993983eb8b719d9e1935c872de63;hp=bee6a0dd45a3e7e840b3782b0807998a8cc7e030;hb=b34179155630f5f4cbea1749af4054a746ded9a4;hpb=63f17cfcf624bc6764d32a7e674baf6329fd2d4a diff --git a/lib/Test/Valgrind/Suppressions.pm b/lib/Test/Valgrind/Suppressions.pm index bee6a0d..1226aab 100644 --- a/lib/Test/Valgrind/Suppressions.pm +++ b/lib/Test/Valgrind/Suppressions.pm @@ -9,11 +9,11 @@ Test::Valgrind::Suppressions - Generate suppressions for given tool and command. =head1 VERSION -Version 1.15 +Version 1.17 =cut -our $VERSION = '1.15'; +our $VERSION = '1.17'; =head1 DESCRIPTION @@ -94,29 +94,30 @@ sub generate { return $status; } -=head2 C +=head2 C - my $mangled_suppression = Test::Valgrind::Suppressions->strip_tail( + my $mangled_suppression = Test::Valgrind::Suppressions->maybe_generalize( $session, $suppression, ); Removes all wildcard frames at the end of the suppression. -Moreover, C<'...'> is appended when C C<3.4.0> or higher is used. +It also replaces sequences of wildcard frames by C<'...'> when C C<3.4.0> or higher is used. Returns the mangled suppression. =cut -sub strip_tail { +sub maybe_generalize { shift; my ($sess, $supp) = @_; 1 while $supp =~ s/[^\r\n]*:\s*\*\s*$//; + # With valgrind 3.4.0, we can replace unknown series of frames by '...' if ($sess->version ge '3.4.0') { - 1 while $supp =~ s/[^\r\n]*\.{3}\s*$//; $supp .= "...\n"; + $supp =~ s/(?:^\s*(?:\.{3}|\*:\S*|obj:\*)\s*\n)+/...\n/mg; } $supp;