xref: /openbsd/gnu/usr.bin/perl/cpan/IPC-SysV/t/pod.t (revision d89ec533)
1################################################################################
2#
3#  Version 2.x, Copyright (C) 2007-2013, Marcus Holland-Moritz <mhx@cpan.org>.
4#  Version 1.x, Copyright (C) 1999, Graham Barr <gbarr@pobox.com>.
5#
6#  This program is free software; you can redistribute it and/or
7#  modify it under the same terms as Perl itself.
8#
9################################################################################
10
11BEGIN {
12  if ($ENV{'PERL_CORE'}) {
13    chdir 't' if -d 't';
14    @INC = '../lib' if -d '../lib' && -d '../ext';
15  }
16
17  require Test::More; import Test::More;
18  require Config; import Config;
19
20  if ($ENV{'PERL_CORE'} && $Config{'extensions'} !~ m[\bIPC/SysV\b]) {
21    plan(skip_all => 'IPC::SysV was not built');
22  }
23}
24
25use strict;
26
27my @pods;
28
29# find all potential pod files
30if (open F, "MANIFEST") {
31  chomp(my @files = <F>);
32  close F;
33  for my $f (@files) {
34    next if $f =~ /ppport/;
35    if (open F, $f) {
36      while (<F>) {
37        if (/^=\w+/) {
38          push @pods, $f;
39          last;
40        }
41      }
42      close F;
43    }
44  }
45}
46
47# load Test::Pod if possible, otherwise load Test::More
48eval {
49  require Test::Pod;
50  $Test::Pod::VERSION >= 0.95
51      or die "Test::Pod version only $Test::Pod::VERSION";
52  import Test::Pod tests => scalar @pods;
53};
54
55if ($@) {
56  require Test::More;
57  import Test::More skip_all => "testing pod requires Test::Pod";
58}
59else {
60  for my $pod (@pods) {
61    pod_file_ok($pod);
62  }
63}
64
65