First, thanx so very much for responding so quickly...
Paul Johnson wrote:
On Sat, Nov 13, 2004 at 12:46:16AM +1100, Leif Eriksen wrote:
Even though Test::More is reporting (via make test) that every test
Could you try putting the use_ok inside a BEGIN block, as Test::More recommends?
OK, will do, though I upgraded to Devel::Config 0.50 first and now I hang...
More details -
This is perl, v5.8.3 built for i386-linux-thread-multi
Linux mother 2.6.8-1.521 #1 Mon Aug 16 09:01:18 EDT 2004 i686 athlon i386 GNU/Linux
Fedora Core release 2 (Tettnang)
Hang is
prompt> HARNESS_PERL_SWITCHES=-MDevel::Cover make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" Monash/t/*.t
Monash/t/Config..................ok
Monash/t/Config_fail.............ok
Monash/t/Config_fail2............ok
Monash/t/DB......................ok 2/0make: *** [test_dynamic] Interrupt (I hit ^C)
I'll revert to 0.49...hang on...nope - still stuck...revert to 0.45 - OK good, not sure what the issue is there
Lets check the coverage.
Nope, still says I haven't been there
<tr><td class="h"><a id="L793">793</a></td><td class="c0"><div class="s">ldap_groups</div></td></tr>
HARNESS_PERL_SWITCHES=-MDevel::Cover=-select,Monash/LDAP make test
Then this shouldn't be necessary.
Lets try it anyway ... nope
Code in Monash/t/LDAP_groups.t is now
#!/usr/bin/perl -w # tests specific to the ldap_groups function use strict; use Test::More qw(no_plan); use Test::MockObject; # Monash::LDAP depends on the services of Monash::Config # this in turn requires two envvars to be set # - SERVER_TYPE and PORTAL_BASE_DIR # Set these for testing
BEGIN { $ENV{PORTAL_BASE_DIR} = `pwd`; $ENV{SERVER_TYPE} = 'Mock'; use_ok( 'Monash::LDAP', qw( ldap_groups ) ); }
can_ok( 'Monash::LDAP', qw( ldap_groups ) );
my $mock = Test::MockObject->new();
# we work through the code, passing or failing code at each cond (if/unless) # bad parameters is(ldap_groups(), 'Error: no filter supplied.'); # failing search $mock->fake_module('Monash::LDAP', ldap_do_search => sub($$) { }, ); is_deeply([ldap_groups(filter => 'filter')], []);
blah blah blah
If this is still a problem, could you confirm that you are using the latest release, 0.50. You're on RH9, right?
See version details from earlier
Read it - um, yeah sure, whatever you say...(note to self - perl internals really are as freaky as everyone says...)http://www.nntp.perl.org/group/perl.perl5.porters/85930?show_headers=0 (I meant use_ok in that message, not isa_ok.)
Can you give me a pointer where to go from here - is it my code at fault ?
Leif