Cross Reference: hints.t
xref
: /
osnet-11
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
lib
/
ExtUtils
/
t
/
hints.t
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
1
N/A
#!/
usr
/
bin
/
perl
-w
1
N/A
1
N/A
BEGIN
{
1
N/A
if
(
$ENV
{
PERL_CORE
} )
{
1
N/A
chdir
't'
;
1
N/A
@
INC
=
(
'../lib'
,
'lib/'
)
;
1
N/A
}
1
N/A
else
{
1
N/A
unshift
@
INC
,
'
t
/
lib
/'
;
1
N/A
}
1
N/A
}
1
N/A
chdir
't'
;
1
N/A
1
N/A
use
File
::
Spec
;
1
N/A
1
N/A
use
Test
::
More
tests
=>
3
;
1
N/A
1
N/A
# Having the CWD in @INC masked a bug in finding hint files
1
N/A
my
$curdir
=
File
::
Spec
->
curdir
;
1
N/A
@
INC
=
grep
{ $_
ne
$curdir
&& $_
ne
'.'
} @
INC
;
1
N/A
1
N/A
mkdir
(
'hints'
,
0777
)
;
1
N/A
my
$hint_file
=
File
::
Spec
->
catfile
(
'hints'
,
"$^
O.pl
"
)
;
1
N/A
open
(
HINT
,
">
$hint_file
"
)
||
die
"Can't write dummy hints file
$hint_file
: $!"
;
1
N/A
print
HINT
<<
'CLOO'
;
1
N/A
$self
->{
CCFLAGS
} =
'basset hounds got long ears'
;
1
N/A
CLOO
1
N/A
close
HINT
;
1
N/A
1
N/A
use
TieOut
;
1
N/A
use
ExtUtils
::
MakeMaker
;
1
N/A
1
N/A
my
$out
=
tie
*
STDERR
,
'TieOut'
;
1
N/A
my
$mm
=
bless
{},
'ExtUtils::MakeMaker'
;
1
N/A
$mm
->
check_hints
;
1
N/A
is
(
$mm
->{
CCFLAGS
},
'basset hounds got long ears'
)
;
1
N/A
is
(
$out
->
read
,
"Processing hints file
$hint_file
\n"
)
;
1
N/A
1
N/A
open
(
HINT
,
">
$hint_file
"
)
||
die
"Can't write dummy hints file
$hint_file
: $!"
;
1
N/A
print
HINT
<<
'CLOO'
;
1
N/A
die
"Argh!\n"
;
1
N/A
CLOO
1
N/A
close
HINT
;
1
N/A
1
N/A
$mm
->
check_hints
;
1
N/A
is
(
$out
->
read
, <<OUT
, 'hint files produce errors' );
1
N/A
Processing hints file $hint_file
1
N/A
Argh!
1
N/A
OUT
1
N/A
1
N/A
END
{
1
N/A
use
File
::
Path
;
1
N/A
rmtree
[
'hints'
];
1
N/A
}