EBCDICification.
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / hints.t
CommitLineData
2d8142c6 1BEGIN {
2 if( $ENV{PERL_CORE} ) {
3 chdir 't';
39234879 4 @INC = ('../lib', 'lib/');
5 }
6 else {
7 unshift @INC, 't/lib/';
2d8142c6 8 }
9}
f6d6199c 10$ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
2d8142c6 11
f6d6199c 12use Test::More tests => 3;
2d8142c6 13
14mkdir 'hints';
39234879 15my $hint_file = "hints/$^O.pl";
16open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
2d8142c6 17print HINT <<'CLOO';
18$self->{CCFLAGS} = 'basset hounds got long ears';
19CLOO
20close HINT;
21
39234879 22use TieOut;
2d8142c6 23use ExtUtils::MakeMaker;
39234879 24
25my $out = tie *STDERR, 'TieOut';
2d8142c6 26my $mm = bless {}, 'ExtUtils::MakeMaker';
27$mm->check_hints;
28is( $mm->{CCFLAGS}, 'basset hounds got long ears' );
39234879 29is( $out->read, "Processing hints file $hint_file\n" );
30
f6d6199c 31open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
32print HINT <<'CLOO';
33die "Argh!\n";
34CLOO
35close HINT;
2d8142c6 36
f6d6199c 37$mm->check_hints;
38is( $out->read, <<OUT, 'hint files produce errors' );
39Processing hints file $hint_file
40Argh!
41OUT
2d8142c6 42
43END {
44 use File::Path;
45 rmtree ['hints'];
46}