]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind.pm
Only allow 24 callers
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind.pm
index 42b6ce633bb52ff59ab0b9d67e540cd8dfaffa21..1df876c3d10fb8f91d8d28d75e21a84ba5fe37a5 100644 (file)
@@ -9,11 +9,11 @@ Test::Valgrind - Generate suppressions, analyse and test any command with valgri
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-Version 1.17
+Version 1.18
 
 =cut
 
 
 =cut
 
-our $VERSION = '1.17';
+our $VERSION = '1.18';
 
 =head1 SYNOPSIS
 
 
 =head1 SYNOPSIS
 
@@ -96,7 +96,7 @@ C<< callers => $number >>
 Specify the maximum stack depth studied when valgrind encounters an error.
 Raising this number improves granularity.
 
 Specify the maximum stack depth studied when valgrind encounters an error.
 Raising this number improves granularity.
 
-Ignored if you supply your own custom C<tool>, otherwise defaults to C<50>.
+Ignored if you supply your own custom C<tool>, otherwise defaults to C<24> (the maximum allowed by C<valgrind>).
 
 =item *
 
 
 =item *
 
@@ -209,12 +209,14 @@ sub analyse {
 
  my $tool = delete $args{tool};
  unless ($tool->$instanceof('Test::Valgrind::Tool')) {
 
  my $tool = delete $args{tool};
  unless ($tool->$instanceof('Test::Valgrind::Tool')) {
+  my $callers = delete $args{callers} || 24;
+  $callers = 24 if $callers <= 0;
   require Test::Valgrind::Tool;
   local $@;
   $tool = eval {
    Test::Valgrind::Tool->new(
   require Test::Valgrind::Tool;
   local $@;
   $tool = eval {
    Test::Valgrind::Tool->new(
-    tool     => $tool || 'memcheck',
-    callers  => delete $args{callers},
+    tool    => $tool || 'memcheck',
+    callers => $callers,
    );
   };
   unless ($tool) {
    );
   };
   unless ($tool) {
@@ -436,7 +438,7 @@ What your tests output to C<STDOUT> and C<STDERR> is eaten unless you pass the C
 
 =head1 DEPENDENCIES
 
 
 =head1 DEPENDENCIES
 
-L<XML::Twig>, L<version>, L<File::HomeDir>, L<Env::Sanctify>, L<Perl::Destruct::Level>.
+L<XML::Twig>, L<File::HomeDir>, L<Env::Sanctify>, L<Perl::Destruct::Level>.
 
 =head1 SEE ALSO
 
 
 =head1 SEE ALSO