From 92648b71984a53114ca978af550613aab7d4fe29 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Tue, 4 Nov 2014 12:49:15 -0800 Subject: [PATCH] allow testing a single plugin --- t/Test/Qpsmtpd.pm | 3 ++- t/plugin_tests.t | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/t/Test/Qpsmtpd.pm b/t/Test/Qpsmtpd.pm index 0630692..c24cbe1 100644 --- a/t/Test/Qpsmtpd.pm +++ b/t/Test/Qpsmtpd.pm @@ -103,7 +103,7 @@ sub varlog { # sub disconnect sub run_plugin_tests { - my $self = shift; + my ($self, $only_plugin) = @_; $self->{_test_mode} = 1; my @plugins = $self->load_plugins(); @@ -111,6 +111,7 @@ sub run_plugin_tests { my $Test = Test::Builder->new(); foreach my $plugin (@plugins) { + next if ($only_plugin && $plugin !~ /$only_plugin/); $plugin->register_tests(); $plugin->run_tests($self); } diff --git a/t/plugin_tests.t b/t/plugin_tests.t index c514d4c..b5f2e65 100644 --- a/t/plugin_tests.t +++ b/t/plugin_tests.t @@ -5,7 +5,7 @@ use Test::Qpsmtpd; 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") { next if !-f $file;