Skip to content
Browse files

add .perl files to the t94kwalitee struct tests and fix the non strict

.perl code
  • Loading branch information...
1 parent e7ff1cf commit d75a4e191268c3e442cb282f678d82f0664b975b Tony Cook committed Sep 6, 2006
Showing with 26 additions and 20 deletions.
  1. +11 −7 doco.perl
  2. +8 −6 errep.perl
  3. +6 −6 filterlist.perl
  4. +1 −1 t/t94kwalitee.t
View
18 doco.perl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+use strict;
use Cwd;
@@ -13,14 +14,17 @@
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 = <FH>; close(FH);
while( $data =~ m/FIXME:(.*?)\*\//sg ) {
printf("%10.10s:%5d %s\n", $file, ptol($data, pos($data)), $1);
@@ -33,7 +37,7 @@
USAGE() if !@ARGV;
my $file = shift;
getfiles();
- local(*FH, $/); open(FH, "$BASE/$file") or die $!;
+ local(*FH, $/); open(FH, "< $file") or die $!;
my $data = <FH>; close(FH);
$data =~ s/^(=item)/\n$1/mg;
$data =~ s/^(=cut)/\n~~~~~~~~\n\n$1\n\n/mg;
@@ -58,12 +62,12 @@ sub USAGE {
}
sub getfiles {
- $BASE=cwd;
+ my $BASE=cwd;
local(*FH);
open(FH,"$BASE/MANIFEST") or die "Cannot open MANIFEST file: $!\n";
my @MANIFEST = <FH>;
chomp(@MANIFEST);
- @CFILES = grep { m/\.c\s*$/ } @MANIFEST;
+ return grep { m/\.(c|im)\s*$/ } @MANIFEST;
}
# string position to line number in string
View
14 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 <<EOF;
@@ -27,7 +28,7 @@
EOF
-$a=<STDIN>;
+my $a=<STDIN>;
chomp($a);
die "Aborted!\n" if $a =~ /^n/i;
@@ -39,7 +40,8 @@
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();
View
12 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 );
}
View
2 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);

0 comments on commit d75a4e1

Please sign in to comment.
Something went wrong with that request. Please try again.