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