From: Vincent Pit Date: Tue, 14 Apr 2009 21:14:31 +0000 (+0200) Subject: This is 1.01 X-Git-Tag: v1.01 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=71206e539601734e8cf8b7197b8327363f9b6cc8;p=perl%2Fmodules%2FTest-Valgrind.git This is 1.01 --- diff --git a/Changes b/Changes index 3ccd94d..6b59d97 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ Revision history for Test-Valgrind +1.01 2009-04-14 21:15 UTC + + Add : Allow testing code given by -e. Hurray for source filters! + + Fix : Lazily load version.pm in Test::Valgrind::Session so that it's + not really needed at configure time. + + Fix : Don't unload dynamic extensions by default so that their symbols + still appear in the stack traces. + 1.00 2009-04-12 22:50 UTC Complete rewrite. The options passed to Test::Valgrind->import have changed, so please have a look at the doc. diff --git a/META.yml b/META.yml index fbe48ed..cc2f1c1 100644 --- a/META.yml +++ b/META.yml @@ -1,12 +1,13 @@ --- #YAML:1.0 name: Test-Valgrind -version: 1.00 +version: 1.01 abstract: Test Perl code through valgrind. author: - Vincent Pit license: perl distribution_type: module configure_requires: + base: 0 Carp: 0 Config: 0 ExtUtils::MakeMaker: 0 @@ -16,16 +17,17 @@ configure_requires: Scalar::Util: 0 version: 0 build_requires: + base: 0 Carp: 0 Digest::MD5: 0 Env::Sanctify: 0 ExtUtils::MakeMaker: 0 Fcntl: 0 - File::Copy: 0 File::HomeDir: 0.86 File::Path: 0 File::Spec: 0 - File::Temp: 0 + File::Temp: 0.14 + Filter::Util::Call: 0 Perl::Destruct::Level: 0 POSIX: 0 Scalar::Util: 0 @@ -34,6 +36,7 @@ build_requires: version: 0 XML::Twig: 0 requires: + base: 0 Carp: 0 Digest::MD5: 0 Env::Sanctify: 0 @@ -41,7 +44,8 @@ requires: File::HomeDir: 0.86 File::Path: 0 File::Spec: 0 - File::Temp: 0 + File::Temp: 0.14 + Filter::Util::Call: 0 perl: 5.006 Perl::Destruct::Level: 0 POSIX: 0 diff --git a/README b/README index ec80e57..ab84bdb 100644 --- a/README +++ b/README @@ -2,17 +2,20 @@ NAME Test::Valgrind - Test Perl code through valgrind. VERSION - Version 1.00 + Version 1.01 SYNOPSIS # From the command-line perl -MTest::Valgrind leaky.pl + # From the command-line, snippet style + perl -MTest::Valgrind -e 'leaky()' + # In a test file use Test::More; eval 'use Test::Valgrind'; plan skip_all => 'Test::Valgrind is required to test your distribution with valgrind' if $@; - ... + leaky(); # In all the test files of a directory prove --exec 'perl -Iblib/lib -Iblib/arch -MTest::Valgrind' t/*.t @@ -34,9 +37,15 @@ DESCRIPTION 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 : +METHODS + "analyse [ %options ]" + Run a "valgrind" analysis configured by %options : + + * "command => $command" + + The Test::Valgrind::Command object (or class name) to use. + + Defaults to Test::Valgrind::Command::PerlScript. * "tool => $tool" @@ -50,29 +59,57 @@ CONFIGURATION Defaults to Test::Valgrind::Action::Test. - * "diag => $bool" + * "file => $file" - If true, print the output of the test script as diagnostics. + The file name of the script to analyse. + + Ignored if you supply your own custom "command", but mandatory + otherwise. * "callers => $number" Specify the maximum stack depth studied when valgrind encounters an error. Raising this number improves granularity. - Default is 12. + Ignored if you supply your own custom "tool", otherwise defaults to + 12. + + * "diag => $bool" + + If true, print the output of the test script as diagnostics. + + Ignored if you supply your own custom "action", otherwise defaults + to false. * "extra_supps => \@files" Also use suppressions from @files besides "perl"'s. + Defaults to empty. + * "no_def_supp => $bool" If true, do not use the default suppression file. -CAVEATS - You can't use this module to test code given by the "-e" command-line - switch. + Defaults to false. + + "import [ %options ]" + 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 highest caller context that looks like a script. When the + analyse finishes, it exists with the status that was returned. + In the child process, it just "return"s so that the calling code is + actually run under "valgrind". + +VARIABLES + $dl_unload + When set to true, all dynamic extensions that were loaded during the + analysis will be unloaded at "END" time by DynaLoader::dl_unload_file. + + Since this obfuscates error stack traces, it's disabled by default. + +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 diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index 46a86c6..f9b28ab 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -9,11 +9,11 @@ Test::Valgrind - Test Perl code through valgrind. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 SYNOPSIS diff --git a/lib/Test/Valgrind/Action.pm b/lib/Test/Valgrind/Action.pm index b25722a..d680855 100644 --- a/lib/Test/Valgrind/Action.pm +++ b/lib/Test/Valgrind/Action.pm @@ -9,11 +9,11 @@ Test::Valgrind::Action - Base class for Test::Valgrind actions. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Action/Captor.pm b/lib/Test/Valgrind/Action/Captor.pm index f366762..c38a2a5 100644 --- a/lib/Test/Valgrind/Action/Captor.pm +++ b/lib/Test/Valgrind/Action/Captor.pm @@ -9,11 +9,11 @@ Test::Valgrind::Action::Captor - Mock Test::Valgrind::Action for capturing outpu =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Action/Suppressions.pm b/lib/Test/Valgrind/Action/Suppressions.pm index 03f412d..9f4d3fb 100644 --- a/lib/Test/Valgrind/Action/Suppressions.pm +++ b/lib/Test/Valgrind/Action/Suppressions.pm @@ -9,11 +9,11 @@ Test::Valgrind::Action::Suppressions - Generate suppressions for a given tool. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Action/Test.pm b/lib/Test/Valgrind/Action/Test.pm index 9c0b698..49149e6 100644 --- a/lib/Test/Valgrind/Action/Test.pm +++ b/lib/Test/Valgrind/Action/Test.pm @@ -9,11 +9,11 @@ Test::Valgrind::Action::Test - Test that an analysis didn't generate any error r =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Carp.pm b/lib/Test/Valgrind/Carp.pm index dfbd8f4..c60777f 100644 --- a/lib/Test/Valgrind/Carp.pm +++ b/lib/Test/Valgrind/Carp.pm @@ -9,11 +9,11 @@ Test::Valgrind::Carp - Carp-like private methods for Test::Valgrind objects. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; sub _croak { shift; diff --git a/lib/Test/Valgrind/Command.pm b/lib/Test/Valgrind/Command.pm index 75dfae9..0b491ba 100644 --- a/lib/Test/Valgrind/Command.pm +++ b/lib/Test/Valgrind/Command.pm @@ -9,11 +9,11 @@ Test::Valgrind::Command - Base class for Test::Valgrind commands. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Command/Perl.pm b/lib/Test/Valgrind/Command/Perl.pm index 091f750..a8e3e8d 100644 --- a/lib/Test/Valgrind/Command/Perl.pm +++ b/lib/Test/Valgrind/Command/Perl.pm @@ -9,11 +9,11 @@ Test::Valgrind::Command::Perl - A Test::Valgrind command that invokes perl. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Command/PerlScript.pm b/lib/Test/Valgrind/Command/PerlScript.pm index a107b79..fbe077e 100644 --- a/lib/Test/Valgrind/Command/PerlScript.pm +++ b/lib/Test/Valgrind/Command/PerlScript.pm @@ -9,11 +9,11 @@ Test::Valgrind::Command::PerlScript - A Test::Valgrind command that invokes a pe =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Report.pm b/lib/Test/Valgrind/Report.pm index 1a02c37..9c31ca9 100644 --- a/lib/Test/Valgrind/Report.pm +++ b/lib/Test/Valgrind/Report.pm @@ -9,11 +9,11 @@ Test::Valgrind::Report - Base class for Test::Valgrind error reports. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; use base qw/Test::Valgrind::Carp/; diff --git a/lib/Test/Valgrind/Session.pm b/lib/Test/Valgrind/Session.pm index b95c1d6..aafaeed 100644 --- a/lib/Test/Valgrind/Session.pm +++ b/lib/Test/Valgrind/Session.pm @@ -9,11 +9,11 @@ Test::Valgrind::Session - Test::Valgrind session object. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Suppressions.pm b/lib/Test/Valgrind/Suppressions.pm index 3ab2f2f..8c34812 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.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Tool.pm b/lib/Test/Valgrind/Tool.pm index 054ce4f..5316521 100644 --- a/lib/Test/Valgrind/Tool.pm +++ b/lib/Test/Valgrind/Tool.pm @@ -9,11 +9,11 @@ Test::Valgrind::Tool - Base class for Test::Valgrind tools. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Tool/SuppressionsParser.pm b/lib/Test/Valgrind/Tool/SuppressionsParser.pm index 3f4c29b..471025a 100644 --- a/lib/Test/Valgrind/Tool/SuppressionsParser.pm +++ b/lib/Test/Valgrind/Tool/SuppressionsParser.pm @@ -9,11 +9,11 @@ Test::Valgrind::Tool::SuppressionsParser - Mock Test::Valgrind::Tool for parsing =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION diff --git a/lib/Test/Valgrind/Tool/memcheck.pm b/lib/Test/Valgrind/Tool/memcheck.pm index 7905871..a9da30b 100644 --- a/lib/Test/Valgrind/Tool/memcheck.pm +++ b/lib/Test/Valgrind/Tool/memcheck.pm @@ -9,11 +9,11 @@ Test::Valgrind::Tool::memcheck - Run an analysis through the memcheck tool. =head1 VERSION -Version 1.00 +Version 1.01 =cut -our $VERSION = '1.00'; +our $VERSION = '1.01'; =head1 DESCRIPTION @@ -188,7 +188,7 @@ use base qw/Test::Valgrind::Report/; use Config qw/%Config/; -our $VERSION = '1.00'; +our $VERSION = '1.01'; my @kinds = qw/ InvalidFree @@ -256,7 +256,7 @@ sub dump { package Test::Valgrind::Tool::memcheck::Twig; -our $VERSION = '1.00'; +our $VERSION = '1.01'; use Scalar::Util; @@ -336,7 +336,7 @@ sub handle_error { package Test::Valgrind::Tool::memcheck::Twig::Elt; -our $VERSION = '1.00'; +our $VERSION = '1.01'; BEGIN { require XML::Twig; }