Commit | Line | Data |
2d8142c6 |
1 | BEGIN { |
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 |
12 | use Test::More tests => 3; |
2d8142c6 |
13 | |
14 | mkdir 'hints'; |
39234879 |
15 | my $hint_file = "hints/$^O.pl"; |
16 | open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!"; |
2d8142c6 |
17 | print HINT <<'CLOO'; |
18 | $self->{CCFLAGS} = 'basset hounds got long ears'; |
19 | CLOO |
20 | close HINT; |
21 | |
39234879 |
22 | use TieOut; |
2d8142c6 |
23 | use ExtUtils::MakeMaker; |
39234879 |
24 | |
25 | my $out = tie *STDERR, 'TieOut'; |
2d8142c6 |
26 | my $mm = bless {}, 'ExtUtils::MakeMaker'; |
27 | $mm->check_hints; |
28 | is( $mm->{CCFLAGS}, 'basset hounds got long ears' ); |
39234879 |
29 | is( $out->read, "Processing hints file $hint_file\n" ); |
30 | |
f6d6199c |
31 | open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!"; |
32 | print HINT <<'CLOO'; |
33 | die "Argh!\n"; |
34 | CLOO |
35 | close HINT; |
2d8142c6 |
36 | |
f6d6199c |
37 | $mm->check_hints; |
38 | is( $out->read, <<OUT, 'hint files produce errors' ); |
39 | Processing hints file $hint_file |
40 | Argh! |
41 | OUT |
2d8142c6 |
42 | |
43 | END { |
44 | use File::Path; |
45 | rmtree ['hints']; |
46 | } |