From: Vincent Pit Date: Thu, 25 Aug 2011 15:19:14 +0000 (+0200) Subject: Switch to qw<> X-Git-Tag: v1.13~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=44f0639e6ac34bdc0be52d47fe2c2df43ab1ca94;p=perl%2Fmodules%2FTest-Valgrind.git Switch to qw<> --- diff --git a/Makefile.PL b/Makefile.PL index b30c074..9697998 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,7 +7,7 @@ use ExtUtils::MakeMaker; BEGIN { eval { require Config }; die 'OS unsupported' if $@; - Config->import(qw/%Config/); + Config->import(qw<%Config>); eval { require File::Spec }; die 'OS unsupported' if $@; } diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index a5883e4..322ab89 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -166,7 +166,7 @@ sub analyse { my $sess = eval { Test::Valgrind::Session->new( min_version => $tool->requires_version, - map { $_ => delete $args{$_} } qw/extra_supps no_def_supp/ + map { $_ => delete $args{$_} } qw ); }; unless ($sess) { diff --git a/lib/Test/Valgrind/Action.pm b/lib/Test/Valgrind/Action.pm index 62c46c9..94991ec 100644 --- a/lib/Test/Valgrind/Action.pm +++ b/lib/Test/Valgrind/Action.pm @@ -23,7 +23,7 @@ Actions are called each time a tool encounter an error and decide what to do wit =cut -use base qw/Test::Valgrind::Component Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Action/Captor.pm b/lib/Test/Valgrind/Action/Captor.pm index 755f5b9..a29f916 100644 --- a/lib/Test/Valgrind/Action/Captor.pm +++ b/lib/Test/Valgrind/Action/Captor.pm @@ -25,7 +25,7 @@ It's not meant to be used directly as an action. use File::Spec (); -use base qw/Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Action/Suppressions.pm b/lib/Test/Valgrind/Action/Suppressions.pm index 8f04896..8a801ec 100644 --- a/lib/Test/Valgrind/Action/Suppressions.pm +++ b/lib/Test/Valgrind/Action/Suppressions.pm @@ -21,7 +21,7 @@ This action just writes the contents of the suppressions reports received into t =cut -use base qw/Test::Valgrind::Action Test::Valgrind::Action::Captor/; +use base qw; =head1 METHODS @@ -45,7 +45,7 @@ sub new { my %validated; - for (qw/name target/) { + for (qw) { my $arg = delete $args{$_}; $class->_croak("'$_' is expected to be a plain scalar") unless $arg and not ref $arg; @@ -54,7 +54,7 @@ sub new { my $self = $class->SUPER::new(%args); - $self->{$_} = $validated{$_} for qw/name target/; + $self->{$_} = $validated{$_} for qw; $self; } @@ -82,7 +82,7 @@ sub start { $self->SUPER::start($sess); - delete @{$self}{qw/status supps diagnostics/}; + delete @{$self}{qw}; $self->save_fh(\*STDOUT => '>' => undef); $self->save_fh(\*STDERR => '>' => undef); diff --git a/lib/Test/Valgrind/Action/Test.pm b/lib/Test/Valgrind/Action/Test.pm index 70991de..36ac416 100644 --- a/lib/Test/Valgrind/Action/Test.pm +++ b/lib/Test/Valgrind/Action/Test.pm @@ -23,7 +23,7 @@ This action uses C to plan and pass or fail tests according to th use Test::Builder; -use base qw/Test::Valgrind::Action Test::Valgrind::Action::Captor/; +use base qw; =head1 METHODS @@ -158,7 +158,7 @@ sub finish { seek $fh, $self->{capture_pos}, 0; $tb->diag($_) while <$fh>; close $fh or $self->_croak('close(capture[' . fileno($fh) . "]): $!"); - delete @{$self}{qw/capture capture_pos/}; + delete @{$self}{qw}; } my $failed = 0; diff --git a/lib/Test/Valgrind/Command.pm b/lib/Test/Valgrind/Command.pm index 15e47b9..81c615d 100644 --- a/lib/Test/Valgrind/Command.pm +++ b/lib/Test/Valgrind/Command.pm @@ -23,7 +23,7 @@ Commands gather information about the target of the analysis. They should also p =cut -use base qw/Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Command/Aggregate.pm b/lib/Test/Valgrind/Command/Aggregate.pm index c526d8a..10a20b9 100644 --- a/lib/Test/Valgrind/Command/Aggregate.pm +++ b/lib/Test/Valgrind/Command/Aggregate.pm @@ -23,7 +23,7 @@ This command groups several commands together, which the session will run under use Scalar::Util (); -use base qw/Test::Valgrind::Command Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Command/Perl.pm b/lib/Test/Valgrind/Command/Perl.pm index 38c238b..bdc8ed3 100644 --- a/lib/Test/Valgrind/Command/Perl.pm +++ b/lib/Test/Valgrind/Command/Perl.pm @@ -26,7 +26,7 @@ use Env::Sanctify (); use Test::Valgrind::Suppressions; -use base qw/Test::Valgrind::Command Test::Valgrind::Carp/; +use base qw; =head1 METHODS @@ -270,7 +270,7 @@ my @cards = List::Util::shuffle(0 .. 51); { package Test::Valgrind::Test::Fake; - use base qw/strict/; + use base qw; } -eval 'use Time::HiRes qw/usleep/'; +eval 'use Time::HiRes qw'; diff --git a/lib/Test/Valgrind/Command/PerlScript.pm b/lib/Test/Valgrind/Command/PerlScript.pm index 0aa3f9e..29eedf4 100644 --- a/lib/Test/Valgrind/Command/PerlScript.pm +++ b/lib/Test/Valgrind/Command/PerlScript.pm @@ -21,7 +21,7 @@ This command is meant to abstract the argument list handling of a C script =cut -use base qw/Test::Valgrind::Command::Perl Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Component.pm b/lib/Test/Valgrind/Component.pm index 15c7cb9..540f147 100644 --- a/lib/Test/Valgrind/Component.pm +++ b/lib/Test/Valgrind/Component.pm @@ -23,7 +23,7 @@ This class is the base for all others that act as components that can be started use Scalar::Util (); -use base qw/Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Parser.pm b/lib/Test/Valgrind/Parser.pm index 087a199..0614e2b 100644 --- a/lib/Test/Valgrind/Parser.pm +++ b/lib/Test/Valgrind/Parser.pm @@ -21,7 +21,7 @@ This class is the base for L parsers. =cut -use base qw/Test::Valgrind::Component Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Parser/Suppressions/Text.pm b/lib/Test/Valgrind/Parser/Suppressions/Text.pm index 6b87cf1..642770e 100644 --- a/lib/Test/Valgrind/Parser/Suppressions/Text.pm +++ b/lib/Test/Valgrind/Parser/Suppressions/Text.pm @@ -23,7 +23,7 @@ This is a L object that can extract suppressions f use Test::Valgrind::Suppressions; -use base qw/Test::Valgrind::Parser::Text Test::Valgrind::Carp/; +use base qw; =head1 METHODS @@ -79,11 +79,11 @@ sub parse { my %call; # Frames to append (if the value is 1) or to prepend (if it's 0) if ($t eq 'm') { # malloc can also be called by calloc or realloc - $call{$_} = 1 for qw/calloc realloc/; + $call{$_} = 1 for qw; } elsif ($t eq 're') { # realloc can also call malloc or free - $call{$_} = 0 for qw/malloc free/; + $call{$_} = 0 for qw; } elsif ($t eq 'c') { # calloc can also call malloc - $call{$_} = 0 for qw/malloc/; + $call{$_} = 0 for qw; } my $c = $_; @@ -138,7 +138,7 @@ This program is free software; you can redistribute it and/or modify it under th package Test::Valgrind::Report::Suppressions; -use base qw/Test::Valgrind::Report/; +use base qw; sub kinds { shift->SUPER::kinds(), 'Suppression' } diff --git a/lib/Test/Valgrind/Parser/Text.pm b/lib/Test/Valgrind/Parser/Text.pm index f17f09e..6320c8b 100644 --- a/lib/Test/Valgrind/Parser/Text.pm +++ b/lib/Test/Valgrind/Parser/Text.pm @@ -21,7 +21,7 @@ This is a L object that can extract suppressions from C< =cut -use base qw/Test::Valgrind::Parser/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Parser/XML.pm b/lib/Test/Valgrind/Parser/XML.pm index d7d232c..be1aa2e 100644 --- a/lib/Test/Valgrind/Parser/XML.pm +++ b/lib/Test/Valgrind/Parser/XML.pm @@ -21,7 +21,7 @@ This is a base class for L objects that can parse C; =head1 METHODS diff --git a/lib/Test/Valgrind/Parser/XML/Twig.pm b/lib/Test/Valgrind/Parser/XML/Twig.pm index e919008..6e29482 100644 --- a/lib/Test/Valgrind/Parser/XML/Twig.pm +++ b/lib/Test/Valgrind/Parser/XML/Twig.pm @@ -24,7 +24,7 @@ It is able to parse the XML output from C up to protocol version 4 and use Scalar::Util (); -use base qw/Test::Valgrind::Parser::XML Test::Valgrind::Carp XML::Twig/; +use base qw; BEGIN { XML::Twig->add_options('Stash'); } @@ -62,7 +62,7 @@ It is reset before and after the parsing phase, so it's effectively only availab =cut eval "sub $_ { \@_ <= 1 ? \$_[0]->{$_} : (\$_[0]->{$_} = \$_[1]) }" - for qw/_session protocol_version/; + for qw<_session protocol_version>; # We must store the session in ourselves because it's only possible to pass # arguments to XML::Twig objects by a global stash. @@ -125,7 +125,7 @@ sub handle_error { $data->{stack} = [ map $_->listify_frame, $node->kid('stack')->children('frame') ]; - for (qw/leakedbytes leakedblocks/) { + for (qw) { my $kid = ($xwhat || $node)->first_child($_); next unless $kid; $data->{$_} = int $kid->text; @@ -194,7 +194,7 @@ our $VERSION = '1.12'; BEGIN { require XML::Twig; } -use base qw/XML::Twig::Elt Test::Valgrind::Carp/; +use base qw; sub kid { my ($self, $what) = @_; @@ -212,7 +212,7 @@ sub listify_frame { map { my $x = $frame->first_child($_); $x ? $x->text : undef - } qw/ip obj fn dir file line/ + } qw ]; } diff --git a/lib/Test/Valgrind/Report.pm b/lib/Test/Valgrind/Report.pm index 44d1c77..46f44b8 100644 --- a/lib/Test/Valgrind/Report.pm +++ b/lib/Test/Valgrind/Report.pm @@ -25,7 +25,7 @@ The C kind is reserved for diagnostics. =cut -use base qw/Test::Valgrind::Carp/; +use base qw; =head2 C<< new kind => $kind, id => $id, data => $data >> diff --git a/lib/Test/Valgrind/Session.pm b/lib/Test/Valgrind/Session.pm index 6c2a16c..951713f 100644 --- a/lib/Test/Valgrind/Session.pm +++ b/lib/Test/Valgrind/Session.pm @@ -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 @@ -295,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 $@; @@ -388,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) @@ -396,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); @@ -428,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; } diff --git a/lib/Test/Valgrind/Suppressions.pm b/lib/Test/Valgrind/Suppressions.pm index 1790243..99e7978 100644 --- a/lib/Test/Valgrind/Suppressions.pm +++ b/lib/Test/Valgrind/Suppressions.pm @@ -21,7 +21,7 @@ This module is an helper for generating suppressions. =cut -use base qw/Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Tool.pm b/lib/Test/Valgrind/Tool.pm index d91ab81..4ecb2e4 100644 --- a/lib/Test/Valgrind/Tool.pm +++ b/lib/Test/Valgrind/Tool.pm @@ -24,7 +24,7 @@ They are expected to function both in suppressions generation and in analysis mo =cut -use base qw/Test::Valgrind::Component Test::Valgrind::Carp/; +use base qw; =head1 METHODS diff --git a/lib/Test/Valgrind/Tool/memcheck.pm b/lib/Test/Valgrind/Tool/memcheck.pm index abb7b6e..8e8371c 100644 --- a/lib/Test/Valgrind/Tool/memcheck.pm +++ b/lib/Test/Valgrind/Tool/memcheck.pm @@ -21,7 +21,7 @@ This class contains the information required by the session for running the C; =head1 METHODS @@ -159,11 +159,11 @@ This program is free software; you can redistribute it and/or modify it under th package Test::Valgrind::Tool::memcheck::Report; -use base qw/Test::Valgrind::Report/; +use base qw; our $VERSION = '1.12'; -my @kinds = qw/ +my @kinds = qw< InvalidFree MismatchedFree InvalidRead @@ -179,7 +179,7 @@ my @kinds = qw/ Leak_IndirectlyLost Leak_PossiblyLost Leak_StillReachable -/; +>; push @kinds, __PACKAGE__->SUPER::kinds(); my %kinds_hashed = map { $_ => 1 } @kinds; diff --git a/t/10-good.t b/t/10-good.t index 2534e51..d3ffb90 100644 --- a/t/10-good.t +++ b/t/10-good.t @@ -15,7 +15,7 @@ if ($@) { { package Test::Valgrind::Test::Fake; - use base qw/strict/; + use base qw; } plan tests => 1; diff --git a/t/92-pod-coverage.t b/t/92-pod-coverage.t index a225486..74b67f4 100644 --- a/t/92-pod-coverage.t +++ b/t/92-pod-coverage.t @@ -42,7 +42,7 @@ pod_coverage_ok('Test::Valgrind::Parser::Text', $trustparents); pod_coverage_ok('Test::Valgrind::Parser::XML', $trustparents); pod_coverage_ok('Test::Valgrind::Parser::XML::Twig', { %$trustparents, - also_private => [ qr/^handle_/, qw/stash/ ], + also_private => [ qr/^handle_/, qw ], }); pod_coverage_ok('Test::Valgrind::Report'); diff --git a/t/lib/Test/Valgrind/Test/Action.pm b/t/lib/Test/Valgrind/Test/Action.pm index 0b40940..8b41a68 100644 --- a/t/lib/Test/Valgrind/Test/Action.pm +++ b/t/lib/Test/Valgrind/Test/Action.pm @@ -3,7 +3,7 @@ package Test::Valgrind::Test::Action; use strict; use warnings; -use base qw/Test::Valgrind::Action::Test/; +use base qw; my $extra_tests;