xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/ExtUtils/t/testlib.t (revision 0:68f95e015346)
1#!/usr/bin/perl -Tw
2
3BEGIN {
4    if( $ENV{PERL_CORE} ) {
5        chdir 't' if -d 't';
6        @INC = '../lib';
7    }
8    else {
9        # ./lib is there so t/lib can be seen even after we chdir.
10        unshift @INC, 't/lib', './lib';
11    }
12}
13chdir 't';
14
15use Test::More tests => 5;
16
17BEGIN {
18    # non-core tests will have blib in their path.  We remove it
19    # and just use the one in lib/.
20    unless( $ENV{PERL_CORE} ) {
21        @INC = grep !/blib/, @INC;
22        unshift @INC, '../lib';
23    }
24}
25
26my @blib_paths = grep /blib/, @INC;
27is( @blib_paths, 0, 'No blib dirs yet in @INC' );
28
29use_ok( 'ExtUtils::testlib' );
30
31@blib_paths = grep { /blib/ } @INC;
32is( @blib_paths, 2, 'ExtUtils::testlib added two @INC dirs!' );
33ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths),
34                    '  and theyre absolute');
35
36eval { eval "# @INC"; };
37is( $@, '',     '@INC is not tainted' );
38