Embedding
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / 00compile.t
CommitLineData
479d2113 1#!/usr/bin/perl -w
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 @INC = ('../lib', 'lib');
6 }
7 else {
8 unshift @INC, 't/lib';
9 }
10}
11chdir 't';
12
13use File::Find;
14use File::Spec;
15use Test::More;
16
17my $Has_Test_Pod;
18BEGIN {
19 $Has_Test_Pod = eval 'use Test::Pod 0.95; 1';
20}
21
22my(@modules);
23
24chdir File::Spec->catdir(File::Spec->updir, 'lib');
25find( sub {
26 return if /~$/;
27 if( $File::Find::dir =~ /^blib|t$/ ) {
28 $File::Find::prune = 1;
29 return;
30 }
31 push @modules, $File::Find::name if /\.pm$/;
32 }, 'ExtUtils'
33);
34
35plan tests => scalar @modules * 2;
36foreach my $file (@modules) {
37 local @INC = @INC;
38 unshift @INC, File::Spec->curdir;
39
40 # This piece of insanity brought to you by non-case preserving
41 # file systems! We have extutils/command.pm, %INC has
42 # ExtUtils/Command.pm
43 # Furthermore, 5.8.0 has a bug about require alone in an eval. Thus
44 # the extra statement.
45 eval q{ require($file); 1 } unless grep { lc $file =~ lc $_ } keys %INC;
46 is( $@, '', "require $file" );
47
48 SKIP: {
49 skip "Test::Pod not installed", 1 unless $Has_Test_Pod;
50 pod_file_ok($file);
51 }
52
53}