r47939 - in /branches/upstream/libtest-valgrind-perl/current: ./ lib/Test/ lib/Test/Valgrind/ lib/Test/Valgrind/Action/ lib/Test/Valgrind/Command/ lib/Test/Valgrind/Parser/ lib/Test/Valgrind/Parser/Suppressions/ lib/Test/Valgrind/Parser/XML/ lib/Test/Valgrind/Tool/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Nov 30 04:20:42 UTC 2009
Author: jawnsy-guest
Date: Mon Nov 30 04:20:36 2009
New Revision: 47939
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47939
Log:
[svn-upgrade] Integrating new upstream version, libtest-valgrind-perl (1.12)
Added:
branches/upstream/libtest-valgrind-perl/current/INSTALL.SKIP
Modified:
branches/upstream/libtest-valgrind-perl/current/Changes
branches/upstream/libtest-valgrind-perl/current/MANIFEST
branches/upstream/libtest-valgrind-perl/current/META.yml
branches/upstream/libtest-valgrind-perl/current/README
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Captor.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Suppressions.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Test.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Carp.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Aggregate.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Perl.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/PerlScript.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Component.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Suppressions/Text.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Text.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML/Twig.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Report.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Session.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Suppressions.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool.pm
branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool/memcheck.pm
Modified: branches/upstream/libtest-valgrind-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/Changes?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/Changes (original)
+++ branches/upstream/libtest-valgrind-perl/current/Changes Mon Nov 30 04:20:36 2009
@@ -1,4 +1,11 @@
Revision history for Test-Valgrind
+
+1.12 2009-11-29 16:45 UTC
+ + Doc : The front documentation in Test::Valgrind was improved.
+ + Fix : Don't install Valgrind.so, as it's only used for testing.
+ + Fix : "Non-portable hex number" warnings.
+ + Fix : Old versions of valgrind could leave some Z-encoded symbols in
+ the stack traces. We now make sure they're always decoded.
1.11 2009-10-08 20:55 UTC
+ Doc : Completion and improvements.
Added: branches/upstream/libtest-valgrind-perl/current/INSTALL.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/INSTALL.SKIP?rev=47939&op=file
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/INSTALL.SKIP (added)
+++ branches/upstream/libtest-valgrind-perl/current/INSTALL.SKIP Mon Nov 30 04:20:36 2009
@@ -1,0 +1,1 @@
+Valgrind\.(?:a|bs|def|dll|la|o|so)$
Modified: branches/upstream/libtest-valgrind-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/MANIFEST?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-valgrind-perl/current/MANIFEST Mon Nov 30 04:20:36 2009
@@ -1,4 +1,5 @@
Changes
+INSTALL.SKIP
MANIFEST
META.yml
Makefile.PL
Modified: branches/upstream/libtest-valgrind-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/META.yml?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/META.yml (original)
+++ branches/upstream/libtest-valgrind-perl/current/META.yml Mon Nov 30 04:20:36 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Test-Valgrind
-version: 1.11
+version: 1.12
abstract: Generate suppressions, analyse and test any command with valgrind.
author:
- Vincent Pit <perl at profvince.com>
Modified: branches/upstream/libtest-valgrind-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/README?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/README (original)
+++ branches/upstream/libtest-valgrind-perl/current/README Mon Nov 30 04:20:36 2009
@@ -3,7 +3,7 @@
with valgrind.
VERSION
- Version 1.11
+ Version 1.12
SYNOPSIS
# From the command-line
@@ -24,17 +24,21 @@
DESCRIPTION
This module is a front-end to the "Test::Valgrind::*" API that lets you
run Perl code through the "memcheck" tool of the "valgrind" memory
- debugger, to test it for memory errors and leaks. If they aren't
- available yet, it will first generate suppressions for the current
- "perl" interpreter and store them in the portable flavour of
+ debugger, to test for memory errors and leaks. If they aren't available
+ yet, it will first generate suppressions for the current "perl"
+ interpreter and store them in the portable flavour of
~/.perl/Test-Valgrind/suppressions/$VERSION. The actual run will then
take place, and tests will be passed or failed according to the result
of the analysis.
- The complete API is much more versatile than this. It allows you to run
- *any* executable under valgrind, generate the corresponding suppressions
- and convert the analysis output to TAP so that it can be incorporated
- into your project's testsuite.
+ The complete API is much more versatile than this. By declaring an
+ appropriate Test::Valgrind::Command class, you can run any executable
+ (that is, not only Perl scripts) under valgrind, generate the
+ corresponding suppressions on-the-fly and convert the analysis result to
+ TAP output so that it can be incorporated into your project's testsuite.
+ If you're not interested in producing TAP, you can output the results in
+ whatever format you like (for example HTML pages) by defining your own
+ Test::Valgrind::Action class.
Due to the nature of perl's memory allocator, this module can't track
leaks of Perl objects. This includes non-mortalized scalars and memory
@@ -103,10 +107,16 @@
In the parent process, "import" calls "analyse" with the arguments it
received itself - except that if no "file" option was supplied, it tries
to pick the first caller context that looks like a script. When the
- analyse ends, it exits with the status that was returned.
+ analysis ends, it exits with the status returned by the action (for the
+ default TAP-generator action, it's the number of failed tests).
In the child process, it just "return"s so that the calling code is
- actually run under "valgrind".
+ actually run under "valgrind", albeit two side-effects :
+
+ * Perl::Destruct::Level is loaded and the destruction level is set to
+ 3.
+
+ * Autoflush on "STDOUT" is turned on.
VARIABLES
$dl_unload
@@ -118,9 +128,9 @@
CAVEATS
Perl 5.8 is notorious for leaking like there's no tomorrow, so the
- suppressions are very likely not to be very accurate on it. Anyhow,
- results will most likely be better if your perl is built with debugging
- enabled. Using the latest "valgrind" available will also help.
+ suppressions are very likely not to be complete on it. You also have a
+ better chance to get more accurate results if your perl is built with
+ debugging enabled. Using the latest "valgrind" available will also help.
This module is not really secure. It's definitely not taint safe. That
shouldn't be a problem for test files.
@@ -160,11 +170,16 @@
perldoc Test::Valgrind
ACKNOWLEDGEMENTS
- Rafaël Garcia-Suarez, for writing and instructing me about the
- existence of Perl::Destruct::Level (Elizabeth Mattijsen is a close
- second).
+ Rafaël Garcia-Suarez, for writing and instructing me about the existence
+ of Perl::Destruct::Level (Elizabeth Mattijsen is a close second).
H.Merijn Brand, for daring to test this thing.
+
+ David Cantrell, for providing shell access to one of his smokers where
+ the tests were failing.
+
+ The debian-perl team, for offering all the feedback they could regarding
+ the build issues they met.
All you people that showed interest in this module, which motivated me
into completely rewriting it.
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
-
-=cut
-
-our $VERSION = '1.11';
+Version 1.12
+
+=cut
+
+our $VERSION = '1.12';
=head1 SYNOPSIS
@@ -34,15 +34,17 @@
=head1 DESCRIPTION
-This module is a front-end to the C<Test::Valgrind::*> API that lets you run Perl code through the C<memcheck> tool of the C<valgrind> memory debugger, to test it for memory errors and leaks.
+This module is a front-end to the C<Test::Valgrind::*> API that lets you run Perl code through the C<memcheck> tool of the C<valgrind> memory debugger, to test for memory errors and leaks.
If they aren't available yet, it will first generate suppressions for the current C<perl> interpreter and store them in the portable flavour of F<~/.perl/Test-Valgrind/suppressions/$VERSION>.
The actual run will then take place, and tests will be passed or failed according to the result of the analysis.
The complete API is much more versatile than this.
-It allows you to run I<any> executable under valgrind, generate the corresponding suppressions and convert the analysis output to TAP so that it can be incorporated into your project's testsuite.
+By declaring an appropriate L<Test::Valgrind::Command> class, you can run any executable (that is, not only Perl scripts) under valgrind, generate the corresponding suppressions on-the-fly and convert the analysis result to TAP output so that it can be incorporated into your project's testsuite.
+If you're not interested in producing TAP, you can output the results in whatever format you like (for example HTML pages) by defining your own L<Test::Valgrind::Action> class.
Due to the nature of perl's memory allocator, this module can't track leaks of Perl objects.
-This includes non-mortalized scalars and memory cycles. However, it can track leaks of chunks of memory allocated in XS extensions with C<Newx> and friends or C<malloc>.
+This includes non-mortalized scalars and memory cycles.
+However, it can track leaks of chunks of memory allocated in XS extensions with C<Newx> and friends or C<malloc>.
As such, it's complementary to the other very good leak detectors listed in the L</SEE ALSO> section.
=head1 METHODS
@@ -195,9 +197,21 @@
=head2 C<import [ %options ]>
In the parent process, L</import> calls L</analyse> with the arguments it received itself - except that if no C<file> option was supplied, it tries to pick the first caller context that looks like a script.
-When the analyse ends, it exits with the status that was returned.
-
-In the child process, it just C<return>s so that the calling code is actually run under C<valgrind>.
+When the analysis ends, it exits with the status returned by the action (for the default TAP-generator action, it's the number of failed tests).
+
+In the child process, it just C<return>s so that the calling code is actually run under C<valgrind>, albeit two side-effects :
+
+=over 4
+
+=item *
+
+L<Perl::Destruct::Level> is loaded and the destruction level is set to C<3>.
+
+=item *
+
+Autoflush on C<STDOUT> is turned on.
+
+=back
=cut
@@ -300,9 +314,13 @@
=head1 CAVEATS
-Perl 5.8 is notorious for leaking like there's no tomorrow, so the suppressions are very likely not to be very accurate on it. Anyhow, results will most likely be better if your perl is built with debugging enabled. Using the latest C<valgrind> available will also help.
-
-This module is not really secure. It's definitely not taint safe. That shouldn't be a problem for test files.
+Perl 5.8 is notorious for leaking like there's no tomorrow, so the suppressions are very likely not to be complete on it.
+You also have a better chance to get more accurate results if your perl is built with debugging enabled.
+Using the latest C<valgrind> available will also help.
+
+This module is not really secure.
+It's definitely not taint safe.
+That shouldn't be a problem for test files.
What your tests output to C<STDOUT> and C<STDERR> is eaten unless you pass the C<diag> option, in which case it will be reprinted as diagnostics.
@@ -339,10 +357,14 @@
=head1 ACKNOWLEDGEMENTS
-Rafaël Garcia-Suarez, for writing and instructing me about the existence of L<Perl::Destruct::Level> (Elizabeth Mattijsen is a close second).
+RafaE<euml>l Garcia-Suarez, for writing and instructing me about the existence of L<Perl::Destruct::Level> (Elizabeth Mattijsen is a close second).
H.Merijn Brand, for daring to test this thing.
+David Cantrell, for providing shell access to one of his smokers where the tests were failing.
+
+The debian-perl team, for offering all the feedback they could regarding the build issues they met.
+
All you people that showed interest in this module, which motivated me into completely rewriting it.
=head1 COPYRIGHT & LICENSE
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Captor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Captor.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Captor.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Captor.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Suppressions.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Suppressions.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Suppressions.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Suppressions.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Test.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Test.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Action/Test.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
-
-=cut
-
-our $VERSION = '1.11';
+Version 1.12
+
+=cut
+
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Carp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Carp.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Carp.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Carp.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Aggregate.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Aggregate.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Aggregate.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Aggregate.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Perl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Perl.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Perl.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/Perl.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
-
-=cut
-
-our $VERSION = '1.11';
+Version 1.12
+
+=cut
+
+our $VERSION = '1.12';
=head1 DESCRIPTION
@@ -23,6 +23,8 @@
=cut
use Env::Sanctify ();
+
+use Test::Valgrind::Suppressions;
use base qw/Test::Valgrind::Command Test::Valgrind::Carp/;
@@ -145,7 +147,7 @@
sub env {
Env::Sanctify->sanctify(
env => {
- PERL_DESTRUCT_LEVEL => 2,
+ PERL_DESTRUCT_LEVEL => 3,
PERL_DL_NONLAZY => 1,
},
);
@@ -176,7 +178,8 @@
or not $report->isa('Test::Valgrind::Report::Suppressions');
my $data = $report->data;
- $data =~ s/^[^\r\n]*\bPerl_runops_(?:standard|debug)\b.*//ms;
+ $data =~ s/[^\r\n]*\bPerl_runops_(?:standard|debug)\b.*//s;
+ $data = Test::Valgrind::Suppressions->strip_tail($session, $data);
$report->new(
id => $report->id,
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/PerlScript.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/PerlScript.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/PerlScript.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Command/PerlScript.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Component.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Component.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Component.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Component.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Suppressions/Text.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Suppressions/Text.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Suppressions/Text.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Suppressions/Text.pm Mon Nov 30 04:20:36 2009
@@ -9,17 +9,19 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
This is a L<Test::Valgrind::Parser::Text> object that can extract suppressions from C<valgrind>'s text output.
=cut
+
+use Test::Valgrind::Suppressions;
use base qw/Test::Valgrind::Parser::Text Test::Valgrind::Carp/;
@@ -44,7 +46,6 @@
s/^\s*#\s//; # Strip comments
next if /^==/; # Valgrind info line
- next if /valgrind/; # and /\Q$file\E/;
s/^\s*//; # Strip leading spaces
s/<[^>]+>//; # Strip tags
@@ -54,18 +55,19 @@
if ($_ eq '{') { # A suppression block begins
$in = 1;
} elsif ($_ eq '}') { # A suppression block ends
- # With valgrind 3.4.0, we can replace unknown series of frames by '...'
- if ($sess->version ge '3.4.0') {
- my $unknown_tail;
- ++$unknown_tail while $s =~ s/(\n)\s*obj:\*\s*$/$1/;
- $s .= "...\n" if $unknown_tail;
- }
-
+ $s = Test::Valgrind::Suppressions->strip_tail($sess, $s); # Strip the tail
push @supps, $s; # Add the suppression that just ended to the list
$s = ''; # Reset the state
$in = 0;
} elsif ($in) { # We're inside a suppresion block
- $s .= "$_\n"; # Append the current line to the state
+ if (/^fun\s*:\s*(.*)/) {
+ # Sometimes valgrind seems to forget to Z-demangle the symbol names.
+ # Make sure it's done and append the result to the state.
+ my $sym = $1;
+ $s .= 'fun:' . Test::Valgrind::Suppressions->maybe_z_demangle($sym) . "\n";
+ } else {
+ $s .= "$_\n";
+ }
}
}
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Text.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Text.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Text.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/Text.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML/Twig.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML/Twig.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML/Twig.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Parser/XML/Twig.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
-
-=cut
-
-our $VERSION = '1.11';
+Version 1.12
+
+=cut
+
+our $VERSION = '1.12';
=head1 DESCRIPTION
@@ -190,7 +190,7 @@
package Test::Valgrind::Parser::XML::Twig::Elt;
-our $VERSION = '1.11';
+our $VERSION = '1.12';
BEGIN { require XML::Twig; }
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Report.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Report.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Report.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Report.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Session.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Session.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Session.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Session.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
-
-=cut
-
-our $VERSION = '1.11';
+Version 1.12
+
+=cut
+
+our $VERSION = '1.12';
=head1 DESCRIPTION
@@ -218,7 +218,11 @@
"Suppressions for this perl stored in $def_supp"
));
}
- push @supp_args, '--suppressions=' . $_ for $self->suppressions;
+ for ($self->suppressions) {
+ next unless -e $_;
+ $self->report($self->report_class->new_diag("Using suppression file $_"));
+ push @supp_args, "--suppressions=$_";
+ }
}
pipe my $vrdr, my $vwtr or $self->_croak("pipe(\$vrdr, \$vwtr): $!");
@@ -314,7 +318,7 @@
=head2 C<report_class>
-Calls C<< ->action->report_class >> with the current session object as the unique argument.
+Calls C<< ->tool->report_class >> with the current session object as the unique argument.
=cut
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Suppressions.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Suppressions.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Suppressions.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Suppressions.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
@@ -88,6 +88,77 @@
return $status;
}
+=head2 C<strip_tail $session, $suppression>
+
+Removes all wildcard frames at the end of the suppression.
+Moreover, C<'...'> is appended when C<valgrind> C<3.4.0> or higher is used.
+Returns the mangled suppression.
+
+=cut
+
+sub strip_tail {
+ 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;
+}
+
+=head2 C<maybe_z_demangle $symbol>
+
+If C<$symbol> is Z-encoded as described in C<valgrind>'s F<include/pub_tool_redir.h>, extract and decode its function name part.
+Otherwise, C<$symbol> is returned as is.
+
+This routine follows C<valgrind>'s F<coregrind/m_demangle/demangle.c:maybe_Z_demangle>.
+
+=cut
+
+my %z_escapes = (
+ a => '*',
+ c => ':',
+ d => '.',
+ h => '-',
+ p => '+',
+ s => ' ',
+ u => '_',
+ A => '@',
+ D => '$',
+ L => '(',
+ R => ')',
+ Z => 'Z',
+);
+
+sub maybe_z_demangle {
+ my ($self, $sym) = @_;
+
+ $sym =~ s/^_vg[rwn]Z([ZU])_// or return $sym;
+
+ my $fn_is_encoded = $1 eq 'Z';
+
+ $sym =~ /^VG_Z_/ and $self->_croak('Symbol with a "VG_Z_" prefix is invalid');
+ $sym =~ s/^[^_]*_//
+ or $self->_croak('Symbol doesn\'t contain a function name');
+
+ if ($fn_is_encoded) {
+ $sym =~ s/Z(.)/
+ my $c = $z_escapes{$1};
+ $self->_croak('Invalid escape sequence') unless defined $c;
+ $c;
+ /ge;
+ }
+
+ $self->_croak('Empty symbol') unless length $sym;
+
+ return $sym;
+}
+
=head1 SEE ALSO
L<Test::Valgrind>, L<Test::Valgrind::Command>, L<Test::Valgrind::Tool>, L<Test::Valgrind::Action::Suppressions>.
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
+Version 1.12
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.12';
=head1 DESCRIPTION
Modified: branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool/memcheck.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool/memcheck.pm?rev=47939&op=diff
==============================================================================
--- branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool/memcheck.pm (original)
+++ branches/upstream/libtest-valgrind-perl/current/lib/Test/Valgrind/Tool/memcheck.pm Mon Nov 30 04:20:36 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.11
-
-=cut
-
-our $VERSION = '1.11';
+Version 1.12
+
+=cut
+
+our $VERSION = '1.12';
=head1 DESCRIPTION
@@ -161,7 +161,7 @@
use base qw/Test::Valgrind::Report/;
-our $VERSION = '1.11';
+our $VERSION = '1.12';
my @kinds = qw/
InvalidFree
@@ -216,9 +216,9 @@
my ($ip, $obj, $fn, $dir, $file, $line) = map { (defined) ? $_ : '?' } @$_;
my $frame;
if ($fn eq '?' and $obj eq '?') {
- $ip =~ s/^0x//g;
- $ip = hex $ip;
- $frame = sprintf "0x%0${pad}X", $ip;
+ $ip =~ s/^0x//gi;
+ my $l = length $ip;
+ $frame = '0x' . ($l < $pad ? ('0' x ($pad - $l)) : '') . uc($ip);
} else {
$frame = sprintf '%s (%s) [%s:%s]', $fn, $obj, $file, $line;
}
More information about the Pkg-perl-cvs-commits
mailing list