From: Vincent Pit Date: Mon, 25 Aug 2008 22:04:45 +0000 (+0200) Subject: This is 0.05 X-Git-Tag: v0.05 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=761b152739f8d47d6fa812b0ca2541cc24363bfc;p=perl%2Fmodules%2FTest-Valgrind.git This is 0.05 --- diff --git a/Changes b/Changes index aece5d7..e26b459 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Test-Valgrind +0.05 2008-08-25 22:05 UTC + + Chg : Lower the default caller to 12. + + Tst : Add a real-life test that gets executed only if you have a C + compiler. + 0.04 2008-05-13 16:25 UTC + Chg : Don't smoke this on 5.005 please. + Chg : Better way to find the valgrind executable. diff --git a/META.yml b/META.yml index 61a6830..350b0ae 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Test-Valgrind -version: 0.04 +version: 0.05 abstract: Test Perl code through valgrind. license: perl author: @@ -18,4 +18,6 @@ meta-spec: version: 1.3 build_requires: ExtUtils::MakeMaker: 0 + File::Copy: 0 Test::More: 0 + XSLoader: 0 diff --git a/README b/README index 10e0c55..e39dbd5 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Test::Valgrind - Test Perl code through valgrind. VERSION - Version 0.04 + Version 0.05 SYNOPSIS use Test::More; @@ -24,30 +24,55 @@ DESCRIPTION perl -MTest::Valgrind leaky.pl + 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 "Newx" and friends or "malloc". As such, it's + complementary to the other very good leak detectors listed in the "SEE + ALSO" section. + CONFIGURATION You can pass parameters to "import" as a list of key / value pairs, where valid keys are : - "supp => $file" + * "supp => $file" + Also use suppressions from $file besides perl's. - "no_supp => $bool" + * "no_supp => $bool" + If true, do not use any suppressions. - "callers => $number" + * "callers => $number" + Specify the maximum stack depth studied when valgrind encounters an - error. Raising this number improves granularity. Default is 50. + error. Raising this number improves granularity. Default is 12. + + * "extra => [ @args ]" - "extra => [ @args ]" Add @args to valgrind parameters. - "diag => $bool" + * "diag => $bool" + If true, print the raw output of valgrind as diagnostics (may be quite verbose). - "no_test => $bool" + * "no_test => $bool" + If true, do not actually output the plan and the tests results. + * "cb => sub { my ($val, $name) = @_; ...; return $passed }" + + Specifies a subroutine to execute for each test instead of + "Test::More::is". It receives the number of bytes leaked in $_[0] + and the test name in $_[1], and is expected to return true if the + test passed and false otherwise. Defaults to + + sub { + is($_[0], 0, $_[1]); + (defined $_[0] and $_[0] == 0) : 1 : 0 + } + CAVEATS You can't use this module to test code given by the "-e" command-line switch. @@ -69,6 +94,9 @@ DEPENDENCIES Perl::Destruct::Level. +SEE ALSO + Devel::Leak, Devel::LeakTrace, Devel::LeakTrace::Fast. + AUTHOR Vincent Pit, "", . diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index e52bd57..bd8a663 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -17,11 +17,11 @@ Test::Valgrind - Test Perl code through valgrind. =head1 VERSION -Version 0.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 SYNOPSIS diff --git a/t/30-bad.t b/t/30-bad.t index 93765cf..271772e 100644 --- a/t/30-bad.t +++ b/t/30-bad.t @@ -31,7 +31,7 @@ sub tester { eval { require XSLoader; - XSLoader::load('Test::Valgrind', 0.04); + XSLoader::load('Test::Valgrind', 0.05); }; if ($@) { plan skip_all => "XS test code not available ($@)";