in reply to Test::Pod:Coverage: excluding 'used' modules

Pod::Coverage (which Test::Pod::Coverage uses) already distinguishes between imported subs and ones you've defined yourself, so unless Date::Manip is doing something weird (which it isn't), this shouldn't be a problem.

I only get that particular error message (requiring 'My::Module' failed) if the module can't actually be compiled; nothing to do with the pod. My guess is Date::Manip isn't installed properly on your system. It's not a core module, so perhaps you just don't have it at all.

  • Comment on Re: Test::Pod:Coverage: excluding 'used' modules

Replies are listed 'Best First'.
Re^2: Test::Pod:Coverage: excluding 'used' modules
by loris (Hermit) on Nov 15, 2019 at 14:19 UTC

    I also expected that Pod::Coverage would exclude the imported modules. However, I do have Date::Manip on my system and the unit tests which rely on it pass. None of the other included modules causes a problem, so maybe Date::Manip is doing something weird?

    Thanks,

    loris

      I was quite vague about "doing something weird". Specifically, I was alluding to installing subs in the caller package in such a way that they don't look like they've been imported. This can be achieved using Sub::Util/Sub::Name or eval, but Date::Manip isn't doing that.

      I really do think your test script is having problems even loading Date::Manip. Is @INC the same for this pod test as for your other tests?

        OK, I seem to have been indulging in some cargo-cult programming. My pod-covarage.t looked like this:

        #!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD co +verage" if $@; all_pod_coverage_ok();

        If I delete the shebang line, everything is OK. I'm not sure where the line came from - I had to look up the meaning of the option '-T', so I don't think it was anything I added consciously. Strangely this line crops in other copies of pod-covarage.t for other modules where it doesn't cause a problem. So there is still something odd going on.

        Cheers,

        loris