stevieb has asked for the wisdom of the Perl Monks concerning the following question:

I've got a distribution who's job it is to wrap an external C/C++ library. There are dozens of functions I'm wrapping, most are loaded directly, a handful of others have C wrappers in my XS that call the wrapped functions in order to make them work properly with Perl.

In my Test::Pod::Coverage RELEASE_TESTING tests, all of the XS functions are 'bare' (ie. no POD coverage). I don't want to write POD for them, as in each of the Perl subs that present them, I put something like this:

=head2 phys_to_gpio($pin_num) Maps to C<int physPinToGpio(int pin)> Converts the pin number on the physical board to the C<GPIO> represent +ation, and returns it. Parameters: $pin_num Mandatory: The pin number on the physical Raspberry Pi board. =head2 phys_to_wpi($pin_num) Maps to C<int physPinToWpi(int pin)> Converts the pin number on the physical board to the C<wiringPi> numbe +ring representation, and returns it. Parameters: $pin_num Mandatory: The pin number on the physical Raspberry Pi board.

That allows the user to see what the C call actually is.

So, my question is, how can I avoid Test::Pod::Coverage failures for subs I do not want to cover, because they are XSUBs, and really not used directly?:

t/pod-coverage.t ..... 1/1 # Failed test 'Pod coverage on WiringPi::API' # at /home/pi/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/ +Test/Pod/Coverage.pm line 133. # Coverage for WiringPi::API is 49.6%, with 60 naked subroutines: # ads1115Setup # analogRead # analogWrite # bmp180Pressure ...

All of my Perl subs are snake_case, so anything with camelCase is C/XS.

Replies are listed 'Best First'.
Re: Ignoring subs in Test::Pod::Coverage?
by choroba (Cardinal) on Jul 01, 2017 at 21:31 UTC
    Maybe add them to private or also_private as documented in Pod::Coverage (and shown in Test::Pod::Coverage , too)?

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      I totally overlooked private. Thanks choroba.

        Hi stevieb. Another way is prefixing the functions considered private with an underscore.

        _ads1115Setup _analogRead _analogWrite _bmp180Pressure