2012-04-08 02:11:16 +02:00
|
|
|
use Config qw/ myconfig /;
|
|
|
|
use Data::Dumper;
|
|
|
|
use English qw/ -no_match_vars /;
|
|
|
|
use File::Find;
|
|
|
|
use Test::More 'no_plan';
|
|
|
|
|
|
|
|
use lib 'lib';
|
|
|
|
|
|
|
|
my $this_perl = $Config{'perlpath'} || $EXECUTABLE_NAME;
|
|
|
|
#ok( $Config{'perlpath'}, "config: $Config{'perlpath'}" );
|
|
|
|
#ok( $EXECUTABLE_NAME, "var: $EXECUTABLE_NAME" );
|
|
|
|
#ok( $this_perl, "this_perl: $this_perl" );
|
|
|
|
|
|
|
|
my @skip_syntax = qw(
|
|
|
|
plugins/milter
|
|
|
|
plugins/auth/auth_ldap_bind
|
|
|
|
plugins/ident/geoip
|
|
|
|
plugins/logging/apache
|
2012-04-29 10:35:59 +02:00
|
|
|
plugins/auth/auth_vpopmail
|
|
|
|
plugins/virus/clamdscan
|
|
|
|
plugins/sender_permitted_from
|
|
|
|
plugins/domainkeys
|
2012-04-08 02:11:16 +02:00
|
|
|
lib/Apache/Qpsmtpd.pm
|
|
|
|
lib/Danga/Client.pm
|
|
|
|
lib/Danga/TimeoutSocket.pm
|
|
|
|
lib/Qpsmtpd/ConfigServer.pm
|
|
|
|
lib/Qpsmtpd/PollServer.pm
|
|
|
|
lib/Qpsmtpd/Plugin/Async/DNSBLBase.pm
|
|
|
|
);
|
|
|
|
my %skip_syntax = map { $_ => 1 } @skip_syntax;
|
|
|
|
#print Dumper(\@skip_syntax);
|
|
|
|
|
|
|
|
my @files = find( {wanted=>\&test_syntax, no_chdir=>1}, 'plugins', 'lib' );
|
|
|
|
|
|
|
|
sub test_syntax {
|
|
|
|
my $f = $File::Find::name;
|
|
|
|
chomp $f;
|
|
|
|
return if ! -f $f;
|
|
|
|
return if $skip_syntax{$f};
|
2012-04-29 10:35:59 +02:00
|
|
|
return if $f =~ m/(~|\.(bak|orig|rej))/;
|
2012-04-08 02:11:16 +02:00
|
|
|
return if $f =~ /async/; # requires ParaDNS
|
2012-04-29 10:35:59 +02:00
|
|
|
my $r = `$this_perl -Ilib -MQpsmtpd::Constants -c $f 2>&1`;
|
2012-04-08 02:11:16 +02:00
|
|
|
my $exit_code = sprintf ("%d", $CHILD_ERROR >> 8);
|
|
|
|
ok( $exit_code == 0, "syntax $f");
|
|
|
|
};
|
|
|
|
|
|
|
|
|