xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/ExtUtils/testlib.pm (revision 0:68f95e015346)
1*0Sstevel@tonic-gatepackage ExtUtils::testlib;
2*0Sstevel@tonic-gate$VERSION = 1.15;
3*0Sstevel@tonic-gate
4*0Sstevel@tonic-gateuse Cwd;
5*0Sstevel@tonic-gateuse File::Spec;
6*0Sstevel@tonic-gate
7*0Sstevel@tonic-gate# So the tests can chdir around and not break @INC.
8*0Sstevel@tonic-gate# We use getcwd() because otherwise rel2abs will blow up under taint
9*0Sstevel@tonic-gate# mode pre-5.8.  We detaint is so @INC won't be tainted.  This is
10*0Sstevel@tonic-gate# no worse, and probably better, than just shoving an untainted,
11*0Sstevel@tonic-gate# relative "blib/lib" onto @INC.
12*0Sstevel@tonic-gatemy $cwd;
13*0Sstevel@tonic-gateBEGIN {
14*0Sstevel@tonic-gate    ($cwd) = getcwd() =~ /(.*)/;
15*0Sstevel@tonic-gate}
16*0Sstevel@tonic-gateuse lib map File::Spec->rel2abs($_, $cwd), qw(blib/arch blib/lib);
17*0Sstevel@tonic-gate1;
18*0Sstevel@tonic-gate__END__
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate=head1 NAME
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gateExtUtils::testlib - add blib/* directories to @INC
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gate=head1 SYNOPSIS
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gate  use ExtUtils::testlib;
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate=head1 DESCRIPTION
29*0Sstevel@tonic-gate
30*0Sstevel@tonic-gateAfter an extension has been built and before it is installed it may be
31*0Sstevel@tonic-gatedesirable to test it bypassing C<make test>. By adding
32*0Sstevel@tonic-gate
33*0Sstevel@tonic-gate    use ExtUtils::testlib;
34*0Sstevel@tonic-gate
35*0Sstevel@tonic-gateto a test program the intermediate directories used by C<make> are
36*0Sstevel@tonic-gateadded to @INC.
37*0Sstevel@tonic-gate
38