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