From: Tony Cook Date: Wed, 6 Sep 2006 13:50:43 +0000 (+0000) Subject: add .perl files to the t94kwalitee struct tests and fix the non strict X-Git-Tag: Imager-0.54~2 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/d75a4e191268c3e442cb282f678d82f0664b975b add .perl files to the t94kwalitee struct tests and fix the non strict .perl code --- diff --git a/doco.perl b/doco.perl index dd195975..8e608def 100755 --- a/doco.perl +++ b/doco.perl @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +use strict; use Cwd; @@ -13,14 +14,17 @@ use Cwd; my $comm = shift or USAGE(); +my @files; if ($comm eq "-f") { - if (!@ARGV) { - getfiles(); - @files = @CFILES; + if (@ARGV) { + @files = @ARGV; + } + else { + @files = getfiles(); } for my $file (@files) { - local(*FH, $/); open(FH,"$BASE/$file") or die $!; + local(*FH, $/); open(FH,"< $file") or die $!; my $data = ; close(FH); while( $data =~ m/FIXME:(.*?)\*\//sg ) { printf("%10.10s:%5d %s\n", $file, ptol($data, pos($data)), $1); @@ -33,7 +37,7 @@ if ($comm eq "-d") { USAGE() if !@ARGV; my $file = shift; getfiles(); - local(*FH, $/); open(FH, "$BASE/$file") or die $!; + local(*FH, $/); open(FH, "< $file") or die $!; my $data = ; close(FH); $data =~ s/^(=item)/\n$1/mg; $data =~ s/^(=cut)/\n~~~~~~~~\n\n$1\n\n/mg; @@ -58,12 +62,12 @@ EOF } sub getfiles { - $BASE=cwd; + my $BASE=cwd; local(*FH); open(FH,"$BASE/MANIFEST") or die "Cannot open MANIFEST file: $!\n"; my @MANIFEST = ; chomp(@MANIFEST); - @CFILES = grep { m/\.c\s*$/ } @MANIFEST; + return grep { m/\.(c|im)\s*$/ } @MANIFEST; } # string position to line number in string diff --git a/errep.perl b/errep.perl index b4ae4cbb..6b4b5fde 100644 --- a/errep.perl +++ b/errep.perl @@ -1,10 +1,11 @@ - +#!perl -w +use strict; use Config; -@precommands=('uname -a','perl -V'); -@manpages=('dlopen','shl_load','dlsym','dlclose'); -@postcommands=map { "man $_ | col -bf | cat -s" } @manpages; +my @precommands=('uname -a','perl -V'); +my @manpages=('dlopen','shl_load','dlsym','dlclose'); +my @postcommands=map { "man $_ | col -bf | cat -s" } @manpages; print <; +my $a=; chomp($a); die "Aborted!\n" if $a =~ /^n/i; @@ -39,7 +40,8 @@ open STDERR, '>&STDOUT' or die $!; rcomm('rm testout/*'); rcomm(@precommands); -rcomm("$^X Makefile.PL") || rcomm("make") || rcomm("make test"); +my $make = $Config{make}; +rcomm("$^X Makefile.PL") || rcomm("$make") || rcomm("$make test TEST_VERBOSE=1"); head("Logfiles from run"); dumplogs(); diff --git a/filterlist.perl b/filterlist.perl index 69ee1998..d73fefeb 100755 --- a/filterlist.perl +++ b/filterlist.perl @@ -1,12 +1,12 @@ #!/usr/bin/perl - +use strict; use Imager; print "Filter Arguments\n"; -for $filt (keys %Imager::filters) { - @callseq=@{$Imager::filters{$filt}{'callseq'}}; - %defaults=%{$Imager::filters{$filt}{'defaults'}}; +for my $filt (keys %Imager::filters) { + my @callseq=@{$Imager::filters{$filt}{'callseq'} || {}}; + my %defaults=%{$Imager::filters{$filt}{'defaults'} || {}}; shift(@callseq); - @b=map { exists($defaults{$_}) ? $_.'('.$defaults{$_}.')' : $_ } @callseq; - $str=join(" ",@b); + my @b=map { exists($defaults{$_}) ? $_.'('.$defaults{$_}.')' : $_ } @callseq; + my $str=join(" ",@b); printf("%-15s %s\n",$filt,$str ); } diff --git a/t/t94kwalitee.t b/t/t94kwalitee.t index f77c635f..a39a9697 100644 --- a/t/t94kwalitee.t +++ b/t/t94kwalitee.t @@ -9,7 +9,7 @@ my $manifest = maniread; # work up counts first -my @pl_files = grep /\.(p[lm]|PL)$/, keys %$manifest; +my @pl_files = grep /\.(p[lm]|PL|perl)$/, keys %$manifest; plan tests => scalar(@pl_files);