Commit | Line | Data |
f6d6199c |
1 | # Test problems in Makefile.PL's and hint files. |
2 | |
3 | BEGIN { |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't' if -d 't'; |
6 | @INC = ('../lib', 'lib'); |
7 | } |
8 | else { |
9 | unshift @INC, 't/lib'; |
10 | } |
11 | } |
45bc4d3a |
12 | chdir 't'; |
f6d6199c |
13 | |
14 | use strict; |
15 | use Test::More tests => 3; |
16 | use ExtUtils::MM; |
17 | use TieOut; |
18 | |
19 | my $MM = bless { DIR => ['subdir'] }, 'MM'; |
20 | |
21 | ok( chdir 'Problem-Module', "chdir'd to Problem-Module" ) || |
22 | diag("chdir failed: $!"); |
23 | |
24 | |
25 | # Make sure when Makefile.PL's break, they issue a warning. |
26 | # Also make sure Makefile.PL's in subdirs still have '.' in @INC. |
f6d6199c |
27 | { |
45bc4d3a |
28 | my $stdout = tie *STDOUT, 'TieOut' or die; |
29 | |
f6d6199c |
30 | my $warning = ''; |
31 | local $SIG{__WARN__} = sub { $warning = join '', @_ }; |
45bc4d3a |
32 | eval { $MM->eval_in_subdirs; }; |
f6d6199c |
33 | |
34 | is( $stdout->read, qq{\@INC has .\n}, 'cwd in @INC' ); |
45bc4d3a |
35 | like( $@, |
36 | qr{^ERROR from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk}, |
f6d6199c |
37 | 'Makefile.PL death in subdir warns' ); |
38 | |
39 | untie *STDOUT; |
40 | } |