1#!/usr/bin/perl -w 2 3BEGIN { 4 unshift @INC, 't/lib'; 5} 6chdir 't'; 7 8use warnings; 9use Test::More; 10 11my $Has_Test_Pod; 12BEGIN { 13 $Has_Test_Pod = eval 'use Test::Pod 0.95; 1'; 14} 15 16plan skip_all => 'No MANIFEST' 17 unless -e "../MANIFEST"; 18 19chdir ".."; 20 21my $manifest = "MANIFEST"; 22open(my $manifest_fh, "<", $manifest) or die "Can't open $manifest: $!"; 23my @modules = map { m{^lib/(\S+)}; $1 } 24 grep { m{^lib/\S+\.pm} } 25 <$manifest_fh>; 26 27chomp @modules; 28close $manifest_fh; 29 30chdir 'lib'; 31plan tests => scalar @modules * 2; 32foreach my $file (@modules) { 33 # Make sure we look at the local files and do not reload them if 34 # they're already loaded. This avoids recompilation warnings. 35 local @INC = @INC; 36 unshift @INC, "."; 37 ok eval { require($file); 1 } or diag "require $file failed.\n$@"; 38 39 SKIP: { 40 skip "Test::Pod not installed", 1 unless $Has_Test_Pod; 41 pod_file_ok($file); 42 } 43} 44