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