#!perl -w
diag(
"WARNING: ignore all warnings from this test ;-)\n"
);
diag(
"osname: $^O"
);
my
$ccname
=
$Config::Config
{ccname};
$ccname
=
'gcc'
if
(
$Config::Config
{gccversion});
$ccname
=
'(unknown compiler)'
unless
$ccname
;
my
$ccversion
= (
$ccname
eq
'gcc'
) ?
$Config::Config
{gccversion} :
$Config::Config
{ccversion};
$ccversion
=
'(unknown version)'
unless
$ccversion
;
diag(
"perl cc: $ccname $ccversion"
);
diag(
"perl version: "
.
$Config::Config
{version} );
eval
{
};
if
($@) {
diag(
"can't load POSIX: uname(), EPERM, and ESRCH details unavailable"
);
}
else
{
diag(
"POSIX::uname: "
.
join
(
" - "
, POSIX::uname()) );
diag(
"EPERM: "
.POSIX->EPERM.
" "
.
"ESRCH: "
.POSIX->ESRCH );
}
diag(
"tested by a "
.
(
defined
(
$ENV
{AUTOMATED_TESTING}) &&
$ENV
{AUTOMATED_TESTING} ?
"smoker"
:
"person"
));
my
%results
;
for
my
$pid
(0..100, $$) {
my
$out
=
kill
0,
$pid
;
my
$key
= (0+$!).
':'
.
"$!"
;
push
@{
$results
{
$key
}},
$pid
;
}
my
@skeys
=
sort
{
my
(
$an
,
$as
) =
split
/:/,
$a
;
my
(
$bn
,
$bs
) =
split
/:/,
$b
;
(
$an
<=>
$bn
) || (
$as
cmp
$bs
)
}
keys
%results
;
foreach
my
$key
(
@skeys
) {
my
(
$errnum
,
$errstr
) =
split
/:/,
$key
;
diag(
"errno $errnum ($errstr) was the result on these pids: "
.
join
(
', '
, @{
$results
{
$key
}}) );
}
ok(
"printed diagnostics"
);