1b39c5158Smillertpackage ExtUtils::testlib; 2b39c5158Smillert 3b39c5158Smillertuse strict; 4b39c5158Smillertuse warnings; 5b39c5158Smillert 6*e0680481Safresh1our $VERSION = '7.70'; 756d68f1eSafresh1$VERSION =~ tr/_//d; 8b39c5158Smillert 9b39c5158Smillertuse Cwd; 10b39c5158Smillertuse File::Spec; 11b39c5158Smillert 12b39c5158Smillert# So the tests can chdir around and not break @INC. 13b39c5158Smillert# We use getcwd() because otherwise rel2abs will blow up under taint 14b39c5158Smillert# mode pre-5.8. We detaint is so @INC won't be tainted. This is 15b39c5158Smillert# no worse, and probably better, than just shoving an untainted, 16b39c5158Smillert# relative "blib/lib" onto @INC. 17b39c5158Smillertmy $cwd; 18b39c5158SmillertBEGIN { 19b39c5158Smillert ($cwd) = getcwd() =~ /(.*)/; 20b39c5158Smillert} 21b39c5158Smillertuse lib map { File::Spec->rel2abs($_, $cwd) } qw(blib/arch blib/lib); 22b39c5158Smillert1; 23b39c5158Smillert__END__ 24b39c5158Smillert 25b39c5158Smillert=head1 NAME 26b39c5158Smillert 27b39c5158SmillertExtUtils::testlib - add blib/* directories to @INC 28b39c5158Smillert 29b39c5158Smillert=head1 SYNOPSIS 30b39c5158Smillert 31b39c5158Smillert use ExtUtils::testlib; 32b39c5158Smillert 33b39c5158Smillert=head1 DESCRIPTION 34b39c5158Smillert 35b39c5158SmillertAfter an extension has been built and before it is installed it may be 36b39c5158Smillertdesirable to test it bypassing C<make test>. By adding 37b39c5158Smillert 38b39c5158Smillert use ExtUtils::testlib; 39b39c5158Smillert 40b39c5158Smillertto a test program the intermediate directories used by C<make> are 41b39c5158Smillertadded to @INC. 42b39c5158Smillert 43