File: 99pod.t

package info (click to toggle)
libapache-authenhook-perl 2.00-04%2Bpristine-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 236 kB
  • sloc: perl: 182; makefile: 13; sh: 11
file content (46 lines) | stat: -rwxr-xr-x 836 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use File::Spec;
use File::Find qw(find);

use strict;

# check that documentation isn't broken

eval {
  # if we have both Test::More and Test::Pod we're good to go
  require Test::More;
  Test::More->import;
  require Test::Pod;
  Test::Pod->import;
};

if ($@) {
  # otherwise we need to plan accordingly - either
  # using Test::More or Test.pm syntax
  eval {
    require Test::More;
  };

  if ($@) {
    require Test;
    Test->import;
    plan(tests => 0);
  }
  else {
    plan(skip_all => 'Test::Pod required for testing POD');
  }
}
else {
  my @files;

  find(
    sub { push @files, $File::Find::name if m!\.p(m|od|l)$! },
    File::Spec->catfile(qw(blib lib))
  );

  plan(tests => scalar @files);

  foreach my $file (@files) {
    # use the older Test::Pod interface for maximum back compat
    pod_file_ok($file);
  }
}