xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/ExtUtils/t/00compile.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!/usr/bin/perl -w
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateBEGIN {
4*0Sstevel@tonic-gate    if( $ENV{PERL_CORE} ) {
5*0Sstevel@tonic-gate        @INC = ('../lib', 'lib');
6*0Sstevel@tonic-gate    }
7*0Sstevel@tonic-gate    else {
8*0Sstevel@tonic-gate        unshift @INC, 't/lib';
9*0Sstevel@tonic-gate    }
10*0Sstevel@tonic-gate}
11*0Sstevel@tonic-gatechdir 't';
12*0Sstevel@tonic-gate
13*0Sstevel@tonic-gateuse File::Find;
14*0Sstevel@tonic-gateuse File::Spec;
15*0Sstevel@tonic-gateuse Test::More;
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gatemy $Has_Test_Pod;
18*0Sstevel@tonic-gateBEGIN {
19*0Sstevel@tonic-gate    $Has_Test_Pod = eval 'use Test::Pod 0.95; 1';
20*0Sstevel@tonic-gate}
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gatechdir File::Spec->updir;
23*0Sstevel@tonic-gatemy $manifest = File::Spec->catfile('MANIFEST');
24*0Sstevel@tonic-gateopen(MANIFEST, $manifest) or die "Can't open $manifest: $!";
25*0Sstevel@tonic-gatemy @modules = map { m{^lib/(\S+)}; $1 }
26*0Sstevel@tonic-gate              grep { m{^lib/ExtUtils/\S*\.pm}  } <MANIFEST>;
27*0Sstevel@tonic-gatechomp @modules;
28*0Sstevel@tonic-gateclose MANIFEST;
29*0Sstevel@tonic-gate
30*0Sstevel@tonic-gatechdir 'lib';
31*0Sstevel@tonic-gateplan tests => scalar @modules * 2;
32*0Sstevel@tonic-gateforeach my $file (@modules) {
33*0Sstevel@tonic-gate    # 5.8.0 has a bug about require alone in an eval.  Thus the extra
34*0Sstevel@tonic-gate    # statement.
35*0Sstevel@tonic-gate    eval { require($file); 1 };
36*0Sstevel@tonic-gate    is( $@, '', "require $file" );
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate    SKIP: {
39*0Sstevel@tonic-gate        skip "Test::Pod not installed", 1 unless $Has_Test_Pod;
40*0Sstevel@tonic-gate        pod_file_ok($file);
41*0Sstevel@tonic-gate    }
42*0Sstevel@tonic-gate}
43