Merge pull request #137 from msimerson/test-limit

allow testing a single plugin
This commit is contained in:
Matt Simerson 2014-11-04 14:43:18 -08:00
commit 1abfd152f2
2 changed files with 3 additions and 2 deletions

View File

@ -103,7 +103,7 @@ sub varlog {
# sub disconnect # sub disconnect
sub run_plugin_tests { sub run_plugin_tests {
my $self = shift; my ($self, $only_plugin) = @_;
$self->{_test_mode} = 1; $self->{_test_mode} = 1;
my @plugins = $self->load_plugins(); my @plugins = $self->load_plugins();
@ -111,6 +111,7 @@ sub run_plugin_tests {
my $Test = Test::Builder->new(); my $Test = Test::Builder->new();
foreach my $plugin (@plugins) { foreach my $plugin (@plugins) {
next if ($only_plugin && $plugin !~ /$only_plugin/);
$plugin->register_tests(); $plugin->register_tests();
$plugin->run_tests($self); $plugin->run_tests($self);
} }

View File

@ -5,7 +5,7 @@ use Test::Qpsmtpd;
my $qp = Test::Qpsmtpd->new(); my $qp = Test::Qpsmtpd->new();
$qp->run_plugin_tests(); $qp->run_plugin_tests($ARGV[0]);
foreach my $file ("./t/config/greylist.dbm", "./t/config/greylist.dbm.lock") { foreach my $file ("./t/config/greylist.dbm", "./t/config/greylist.dbm.lock") {
next if !-f $file; next if !-f $file;