1b39c5158Smillert################################################################################ 2b39c5158Smillert# 3e5157e49Safresh1# 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 11*eac174f2Safresh1use strict; 12*eac174f2Safresh1use warnings; 13*eac174f2Safresh1 14*eac174f2Safresh1our %Config; 15b39c5158SmillertBEGIN { 16b39c5158Smillert if ($ENV{'PERL_CORE'}) { 17b39c5158Smillert chdir 't' if -d 't'; 18b39c5158Smillert @INC = '../lib' if -d '../lib' && -d '../ext'; 19b39c5158Smillert } 20b39c5158Smillert 21*eac174f2Safresh1 require Test::More; Test::More->import; 22*eac174f2Safresh1 require Config; Config->import; 23b39c5158Smillert 24b39c5158Smillert if ($ENV{'PERL_CORE'} && $Config{'extensions'} !~ m[\bIPC/SysV\b]) { 25b39c5158Smillert plan(skip_all => 'IPC::SysV was not built'); 26b39c5158Smillert } 27b39c5158Smillert} 28b39c5158Smillert 29b39c5158Smillertmy @pods; 30b39c5158Smillert 31b39c5158Smillert# find all potential pod files 32b39c5158Smillertif (open F, "MANIFEST") { 33b39c5158Smillert chomp(my @files = <F>); 34b39c5158Smillert close F; 35b39c5158Smillert for my $f (@files) { 36b39c5158Smillert next if $f =~ /ppport/; 37b39c5158Smillert if (open F, $f) { 38b39c5158Smillert while (<F>) { 39b39c5158Smillert if (/^=\w+/) { 40b39c5158Smillert push @pods, $f; 41b39c5158Smillert last; 42b39c5158Smillert } 43b39c5158Smillert } 44b39c5158Smillert close F; 45b39c5158Smillert } 46b39c5158Smillert } 47b39c5158Smillert} 48b39c5158Smillert 49b39c5158Smillert# load Test::Pod if possible, otherwise load Test::More 50b39c5158Smillerteval { 51b39c5158Smillert require Test::Pod; 52b39c5158Smillert $Test::Pod::VERSION >= 0.95 53b39c5158Smillert or die "Test::Pod version only $Test::Pod::VERSION"; 54*eac174f2Safresh1 Test::Pod->import( tests => scalar @pods ); 55b39c5158Smillert}; 56b39c5158Smillert 57b39c5158Smillertif ($@) { 58b39c5158Smillert require Test::More; 59*eac174f2Safresh1 Test::More->import( skip_all => "testing pod requires Test::Pod" ); 60b39c5158Smillert} 61b39c5158Smillertelse { 62b39c5158Smillert for my $pod (@pods) { 63b39c5158Smillert pod_file_ok($pod); 64b39c5158Smillert } 65b39c5158Smillert} 66b39c5158Smillert 67