On Tue, 2007-03-27 at 03:04 -0700, Ask Bjørn Hansen wrote:
> On Mar 26, 2007, at 11:21, Guy Hulbert wrote:
> 
> > On Mon, 2007-03-26 at 12:18 -0400, Guy Hulbert wrote:
> >> I've uploaded three plugin tests and supporting files to the tracker:
> >> http://code.google.com/p/smtpd/issues/list
> >>
> >> as issue 14.
> 
> Awesome!    We really need that...
> 
> > I forgot to mention that this generates a warning via line 81 of
> > t/Test/Qpsmtpd.pm ... I have since discovered some arguments [...]
> 
> Please make a note of it in issue#14.  :-)

Done.  There is one more thing.  I will add the following to the tracker
as well.  You will have to rename all the plugin tests, which come from
subdirectories of ./plugins/ if you make this fix.

The function 'run_plugin_tests' in t/Test/Qpsmtpd.pm uses the plugin
list read from config.sample/plugins and the plugin is loaded by
'_load_plugin' in lib/Qpsmtpd.pm via 'compile' in lib/Qpsmtpd/Plugin.pm

The name of the plugin is passed by _load_plugin to _compile is
'auth::authnull' when the plugin is loaded from path 'auth/authnull'.

It was tricky to find this because 'compile' fails to load the test-code
silently (presumably because there aren't many tests yet).

Here is the code from '_load_plugin':

        if (-e "$dir/$plugin") {
          Qpsmtpd::Plugin->compile($plugin_name, $package,
            "$dir/$plugin", $self->{_test_mode});

Here is 'compile':

        sub compile {
            my ($class, $plugin, $package, $file, $test_mode) = @_;
        
            my $sub;
            open F, $file or die "could not open $file: $!";

it uses $file to find the plugin itself but:

    if ($test_mode) {
        if (open(F, "t/plugin_tests/$plugin")) {

it uses $plugin to load the test -- but $plugin is really $plugin_name
where it "should" be the relative path to the plugin_test.

Bash doesn't like colons (it escapes them) in file names ... 


> 
> 
>   - ask

-- 
--gh


Reply via email to