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
> ran and I had a 100% pass, some subs (such as ldap_groups that I expand
> upon here) are marked by D::C as never being run - even though there is
> a whole t-file dedicated to just that sub that did indeed run.
>
> The module has a sub 'ldap_groups()', that is in the @EXPORT_OK for
> the module.
>
> The t file is basically
> <code>
> #!/usr/bin/perl -w
> # tests specific to the ldap_groups function
> use strict;
> use Test::More qw(no_plan);
> use Test::MockObject;
> use_ok( 'Monash::LDAP', qw( ldap_groups ) );
Could you try putting the use_ok inside a BEGIN block, as Test::More
recommends?
> Now, in order to get around the fact that use_ok('Monash::LDAP', ...)
> seems to stop D::C instrumenting Monash::LDAP, I call the test harness as
>
> HARNESS_PERL_SWITCHES=-MDevel::Cover=-select,Monash/LDAP make test
Then this shouldn't be necessary.
> However, I still get a report from cover that ldap_groups() is untested,
> even though Test::More says it passed 100%
If this is still a problem, could you confirm that you are using the
latest release, 0.50. You're on RH9, right?
> Is there some interaction with Test::More::use_ok that is stopping D::C
> instrumenting the module correctly ?
It's possible. I fixed a bug in this area which first appeared in
perl-5.8.3. Which version are you using? Still redhat's dodgy 5.8.0?
http://www.nntp.perl.org/group/perl.perl5.porters/85930?show_headers=0
(I meant use_ok in that message, not isa_ok.)
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net