pjf / ipc-system-simple

Perl module to make running system commands and capturing errors as simple as possible.
http://search.cpan.org/perldoc?IPC::System::Simple
Other
19 stars 20 forks source link

t/08_core.t not working on OS X #5

Closed haarg closed 11 years ago

haarg commented 11 years ago

On Mac OS X, core dumps are generated in the /cores directory. If the directory doesn't exist (the default) or isn't writable, no core dump is generated, and thus isn't shown in $? or ${^CHILD_ERROR_NATIVE}.

pjf commented 11 years ago

D'oh!

I don't suppose you have sample test output you can cut/paste/attach?

haarg commented 11 years ago
$ perl -Ilib t/08_core.t
1..3
ok 1 - use IPC::System::Simple;
ok 2 - Signal caught,   $? = 6
not ok 3 - Coredump caught, $? = 6
#   Failed test 'Coredump caught, $? = 6'
#   at t/08_core.t line 41.
#                   '"/Users/gknop/perl5/perls/v5.18.1/bin/perl" died to signal "ABRT" (6) at t/08_core.t line 37.
# '
#     doesn't match '(?^:dumped core)'
# Looks like you failed 1 test of 3.
rjbs commented 11 years ago

Same here, same error. I am at your disposal for test cases.

Leont commented 11 years ago

I suspect this is a consequence of #6, previously this issue wasn't visible because most people don't have BSD::Resource installed. That said, solving that bug only hides this issue to people who don't have BSD::Resource installed, it won't actually solve it.

pjf commented 11 years ago

Well, poo. How do we classify the bug here? If you're on a Mac, and it doesn't dump core because you don't have the directory, then IPC::Simple::Simple is correctly detecting there's no core-dump.

The best I can spot is that we skip the test on OSX, or we do some kind of complicated dance to figure out when core should be dumped and isn't, or vice-versa. I think we're skipping.

pjf commented 11 years ago

Anyone (@rjbs?) able to quickly grab the latest head (623f5ee) and do a dzil test on OS X? I'm presuming that testing $^O is sufficient, but I don't have a mac to verify on myself.

haarg commented 11 years ago

The test would basically be skip if $^O eq 'darwin' && !(-d "/cores" && -w _); So it's not all that complex, but still feels rather ugly and arbitrary. I wouldn't mind just always skipping on OS X.

haarg commented 11 years ago

Confirmed that the latest commit skips properly on OS X.

pjf commented 11 years ago

@haarg : Awesome, thank you!

Released as v1.24 to the CPAN. Thanks everyone!