Subject: | Check $? before determining the exit code. |
$ perl -wle 'use Test::More tests => 1; $SIG{__DIE__} = ""; pass; die'
1..1
ok 1
Died at -e line 1.
$ echo $?
0
$ perl -wle 'use Test::More tests => 1; pass; die'
1..1
ok 1
Died at -e line 1.
# Looks like your test died just after 1.
$ echo $?
255
If the __DIE__ handler is deleted or overriden Test::More will think
nothing died and set the $? to 0. This is bad. It should probably look
at $? first. In fact, this might make the die handler unnecessary.