note
bronto
<p>I just used a similar trick for a [id://253945|module I am going to release] (hopefully) soon. To test it extensively I need a directory server handy, and a subtree in it to try a bunch of operations on it. Obviously I can't assume that the condition applies on every possible site the module will be installed in, so I put this code on the script headers:</p>
<code>
use Test::More tests => 18 ; #18
my $fulltest = 18 ;
my $shorttest = 2 ;
BEGIN {
use_ok('Net::LDAP::Simple') ;
use_ok('Net::LDAP::Entry') ;
}
SKIP: {
skip "doing local tests only",$fulltest-$shorttest
unless $ENV{TEST_HOST} ;
my $server = $ENV{TEST_HOST} || 'localhost' ;
my $port = $ENV{TEST_PORT} || 389 ;
my $base = $ENV{TEST_BASE} || 'ou=simple,o=test' ;
my $binddn = $ENV{TEST_BINDDN} || 'cn=admin,o=test' ;
my $bindpw = $ENV{TEST_BINDPW} || 'secret' ;
</code>
<p>So, to run all the tests one should run them at least with something like <code>TEST_HOST='server.ldap.my' make test</code></p>
<p>Ciao!<br><tt>--bronto</tt></p>
<hr>
<blockquote><small><i>The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).</i>
<br>--[John M. Dlugosz]</small></blockquote>
254011
254011