Skip to content

Commit

Permalink
add .perl files to the t94kwalitee struct tests and fix the non strict
Browse files Browse the repository at this point in the history
.perl code
  • Loading branch information
Tony Cook committed Sep 6, 2006
1 parent e7ff1cf commit d75a4e1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
18 changes: 11 additions & 7 deletions doco.perl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
use strict;

use Cwd;

Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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
Expand Down
14 changes: 8 additions & 6 deletions errep.perl
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -27,7 +28,7 @@
EOF

$a=<STDIN>;
my $a=<STDIN>;
chomp($a);
die "Aborted!\n" if $a =~ /^n/i;

Expand All @@ -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();

Expand Down
12 changes: 6 additions & 6 deletions filterlist.perl
Original file line number Diff line number Diff line change
@@ -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 );
}
2 changes: 1 addition & 1 deletion t/t94kwalitee.t
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d75a4e1

Please sign in to comment.