| 1 | # Copyright 2001-2026, Paul Johnson (paul@pjcj.net) | ||
| 2 | |||
| 3 | # This software is free. It is licensed under the same terms as Perl itself. | ||
| 4 | |||
| 5 | # The latest version of this software should be available from my homepage: | ||
| 6 | # https://pjcj.net | ||
| 7 | |||
| 8 | package Devel::Cover::Pod; | ||
| 9 | |||
| 10 | use strict; | ||
| 11 | use warnings; | ||
| 12 | |||
| 13 | our $VERSION = '1.52'; # VERSION | ||
| 14 | |||
| 15 | use base "Devel::Cover::Criterion"; | ||
| 16 | |||
| 17 | BEGIN { eval "use Pod::Coverage 0.06" } # We'll use this if it is available. | ||
| 18 | |||
| 19 | sub uncoverable { $_[0][2] } | ||
| 20 | sub covered { $_[0][0] ? 1 : 0 } | ||
| 21 | sub total { 1 } | ||
| 22 | sub percentage { $_[0][0] ? 100 : 0 } | ||
| 23 | sub error { $_[0]->simple_error } | ||
| 24 | sub criterion { "pod" } | ||
| 25 | |||
| 26 | sub calculate_summary { | ||
| 27 | my $self = shift; | ||
| 28 | my ($db, $file) = @_; | ||
| 29 | |||
| 30 | return unless $INC{"Pod/Coverage.pm"}; | ||
| 31 | |||
| 32 | my $s = $db->{summary}; | ||
| 33 | |||
| 34 | $self->aggregate($s, $file, 'total', $self->total); | ||
| 35 | $self->aggregate($s, $file, 'covered', 1) if $self->covered; | ||
| 36 | $self->aggregate($s, $file, 'error', $self->error); | ||
| 37 | } | ||
| 38 | |||
| 39 | 1 | ||
| 40 | |||
| 41 | __END__ |