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