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