X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FSession.pm;h=01e6dcd9abac107412c6a72a921f44b0020de59c;hb=9314897b9f4c46057ac5147c0fb4c8fc6dd466a9;hp=27aa97344c3d8b4c474c889e3ce9f06df2843ea5;hpb=2d1051a7ab93eee13b726edd0b353342e683bc2b;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Session.pm b/lib/Test/Valgrind/Session.pm index 27aa973..01e6dcd 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.11 +Version 1.12 =cut -our $VERSION = '1.11'; +our $VERSION = '1.12'; =head1 DESCRIPTION @@ -30,7 +30,7 @@ use POSIX (); # SIGKILL use version (); -use base qw/Test::Valgrind::Carp/; +use base qw; =head1 METHODS @@ -153,7 +153,7 @@ Read-only accessor for the C option. =cut -eval "sub $_ { \$_[0]->{$_} }" for qw/valgrind no_def_supp/; +eval "sub $_ { \$_[0]->{$_} }" for qw; =head2 C @@ -177,7 +177,7 @@ sub run { my %args = @_; $self->start(%args); - my $guard = bless sub { $self->finish } => 'Test::Valgrind::Session::Guard'; + my $guard = Test::Valgrind::Session::Guard->new(sub { $self->finish }); $self->_run($args{command}); } @@ -271,7 +271,9 @@ sub _run { return; } -sub Test::Valgrind::Session::Guard::DESTROY { $_[0]->() } +sub Test::Valgrind::Session::Guard::new { bless \($_[1]), $_[0] } + +sub Test::Valgrind::Session::Guard::DESTROY { ${$_[0]}->() } =head2 C @@ -293,7 +295,7 @@ Read-only accessor for the C associated to the current run. my @members; BEGIN { - @members = qw/action tool command parser/; + @members = qw; for (@members) { eval "sub $_ { \@_ <= 1 ? \$_[0]->{$_} : (\$_[0]->{$_} = \$_[1]) }"; die if $@; @@ -386,7 +388,7 @@ sub start { my %args = @_; - for (qw/action tool command/) { + for (qw) { my $base = 'Test::Valgrind::' . ucfirst; my $value = $args{$_}; $self->_croak("Invalid $_") unless Scalar::Util::blessed($value) @@ -394,7 +396,7 @@ sub start { $self->$_($args{$_}) } - delete @{$self}{qw/last_status exit_code/}; + delete @{$self}{qw}; $self->tool->start($self); $self->parser($self->parser_class->new)->start($self); @@ -426,7 +428,7 @@ sub report { return unless defined $report; - for my $handler (qw/tool command/) { + for my $handler (qw) { $report = $self->$handler->filter($self, $report); return unless defined $report; } @@ -491,7 +493,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009 Vincent Pit, all rights reserved. +Copyright 2009,2010,2011 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.