develooper Front page | perl.perl5.porters | Postings from May 2010

Inconsistent exit code between architectures?

Thread Next
Jose Luis Martinez
May 29, 2010 08:03
Inconsistent exit code between architectures?
Message ID:

    I'm writing because I seem to be detecting some inconsistencies 
between platforms in perls' exit code when die is called. Hope it's the 
right list!

    I'm getting FAIL on some perls because one of my tests don't pass, 
as you can see in:

    The test that fails is:
#   Failed test 'Exit code 9 for ./t/bin/notok_using_die_in_begin.t'
#   at t/002_test_outputs.t line 87.
#          got: 255
#     expected: 9
# Looks like you failed 1 test of 108.

    It basically executes a script that uses a module that only has
BEGIN { die 'DIED!!!' }
    in it's body. I found the exit code to be 9 (I was really expecting 
a 255).

    The thing is that on some platforms I get exit code 9 (tests pass) 
and on some exit code 255 (tests fail).

    I really don't know what the exit code 9 from perl stands for... But 
ultimately, it's not behaving in the same manner under different platforms.

    Some notes on the test suite: I see that I've declared "use 
DieModule;" in the script, but t/lib/ contains the wrong 
package name (dumb of me...):
package EvalModule;

    die "DIED!!!";


If I alter the package name to DieModule and do

$ perl -MDieModule ; echo 'EXIT' $?
DIED!!! at line 4.
BEGIN failed--compilation aborted at line 5.
Compilation failed in require.
BEGIN failed--compilation aborted.

    This last example, if executed on other platforms returns 255

    Am I on to something? Or just plain wrong?

Jose Luis Martinez

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About