5 use vars
qw($dir $file $prog $idx $state $output %progs @dirs);
9 @dirs = qw(plugins plugins-scripts);
11 foreach $dir (@dirs) {
12 opendir(DIR
, $dir) || die "can't opendir $dir: $!";
13 while ($file = readdir(DIR
)) {
14 if (-x
"$dir/$file" && -f
"$dir/$file") {
16 $progs{"$dir/$file"} = $file;
24 for $prog (keys %progs) {
26 $file = `basename $prog`;
29 $output = `$prog -h 2>&1`;
30 if($?
) {$state++;print "$prog failed test $idx\n";}
31 unless ($output =~ m/$progs{$prog}/ms) {
32 $idx++; $state++;print "$output\n$prog failed test $idx\n";
36 `$prog --help 2>&1 > /dev/null`;
37 if($?
) {$state++;print "$prog failed test $idx\n";}
40 `$prog -V 2>&1 > /dev/null`;
41 if($?
) {$state++;print "$prog failed test $idx\n";}
44 `$prog --version 2>&1 > /dev/null`;
45 if($?
) {$state++;print "$prog failed test $idx\n";}
47 print "$prog ($idx tests) ";