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 | |
by stevieb (Canon) on Jul 01, 2017 at 21:36 UTC | |
by marioroy (Prior) on Jul 01, 2017 at 22:52 UTC | |
by stevieb (Canon) on Jul 01, 2017 at 23:11 UTC |