| 1 |
use Test::More; |
| 2 |
|
| 3 |
# Check our Pod |
| 4 |
# The test was provided by Andy Lester, |
| 5 |
# who stole it from Brian D. Foy |
| 6 |
# Thanks to both ! |
| 7 |
|
| 8 |
use File::Spec; |
| 9 |
use File::Find; |
| 10 |
use strict; |
| 11 |
|
| 12 |
eval { |
| 13 |
require Test::Pod; |
| 14 |
Test::Pod->import; |
| 15 |
}; |
| 16 |
|
| 17 |
require './Makefile.PL'; |
| 18 |
# Loaded from Makefile.PL |
| 19 |
our %module = get_module_info(); |
| 20 |
|
| 21 |
my @files; |
| 22 |
|
| 23 |
if ($@) { |
| 24 |
plan skip_all => "Test::Pod required for testing POD"; |
| 25 |
} |
| 26 |
elsif ($Test::Pod::VERSION < 0.95) { |
| 27 |
plan skip_all => "Test::Pod 0.95 required for testing POD"; |
| 28 |
} |
| 29 |
else { |
| 30 |
my $blib = File::Spec->catfile(qw(blib lib)); |
| 31 |
find(\&wanted, grep { -d } ($blib)); |
| 32 |
|
| 33 |
if( my $exe = $module{EXE_FILES}) { |
| 34 |
push @files, @$exe; |
| 35 |
}; |
| 36 |
|
| 37 |
plan tests => scalar @files; |
| 38 |
foreach my $file (@files) { |
| 39 |
pod_file_ok($file); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
sub wanted { |
| 44 |
push @files, $File::Find::name if /\.p(l|m|od)$/; |
| 45 |
} |