Commit | Line | Data |
479d2113 |
1 | #!/usr/bin/perl -w |
2 | |
3 | BEGIN { |
b78fd716 |
4 | unshift @INC, 't/lib'; |
479d2113 |
5 | } |
6 | chdir 't'; |
7 | |
479d2113 |
8 | use Test::More; |
9 | |
10 | my $Has_Test_Pod; |
11 | BEGIN { |
12 | $Has_Test_Pod = eval 'use Test::Pod 0.95; 1'; |
13 | } |
14 | |
cb06ebec |
15 | chdir ".."; |
16 | my $manifest = "MANIFEST"; |
5bdf71cc |
17 | open(my $manifest_fh, "<", $manifest) or die "Can't open $manifest: $!"; |
8b19c1f8 |
18 | my @modules = map { m{^lib/(\S+)}; $1 } |
b78fd716 |
19 | grep { m{^lib/\S+\.pm} } |
20 | <$manifest_fh>; |
8b19c1f8 |
21 | |
dedf98bc |
22 | chomp @modules; |
5bdf71cc |
23 | close $manifest_fh; |
dedf98bc |
24 | |
25 | chdir 'lib'; |
479d2113 |
26 | plan tests => scalar @modules * 2; |
27 | foreach my $file (@modules) { |
a592ba15 |
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$@"; |
479d2113 |
33 | |
34 | SKIP: { |
35 | skip "Test::Pod not installed", 1 unless $Has_Test_Pod; |
36 | pod_file_ok($file); |
37 | } |
479d2113 |
38 | } |