1 # Test problems in Makefile.PL's and hint files.
4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
15 use Test::More tests => 6;
17 use MakeMaker::Test::Setup::Problem;
20 my $MM = bless { DIR => ['subdir'] }, 'MM';
22 ok( setup_recurs(), 'setup' );
24 ok( chdir File::Spec->updir );
25 ok( teardown_recurs(), 'teardown' );
28 ok( chdir 'Problem-Module', "chdir'd to Problem-Module" ) ||
29 diag("chdir failed: $!");
32 # Make sure when Makefile.PL's break, they issue a warning.
33 # Also make sure Makefile.PL's in subdirs still have '.' in @INC.
35 my $stdout = tie *STDOUT, 'TieOut' or die;
38 local $SIG{__WARN__} = sub { $warning = join '', @_ };
39 eval { $MM->eval_in_subdirs; };
41 is( $stdout->read, qq{\@INC has .\n}, 'cwd in @INC' );
43 qr{^ERROR from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk},
44 'Makefile.PL death in subdir warns' );