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