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