Subject: | JUnit don't report when segfault occure |
cat segfault2.t
#!/usr/bin/perl
use strict;
use warnings;
use POSIX;
$|=1;
print "1..1\nok\n";
kill POSIX::SIGSEGV => $$;
Let's try test it
prove --formatter TAP::Formatter::JUnit ./segfault2.t
<testsuites>
<testsuite failures="0"
errors="0"
tests="1"
name="segfault2_t">
<testcase name="1"></testcase>
<system-out><![CDATA[1..1
ok
]]></system-out>
<system-err></system-err>
</testsuite>
</testsuites>
So we don't see a problem and think that all right.
I've pathed TAP/Formatter/JUnit/Session.pm
181a182,183
Show quoted text
> } elsif ( my $wait = $parser->wait ) {
> $die_msg = "Non-zero wait status: $wait";
after apply this patch, when we run test
prove --formatter TAP::Formatter::JUnit ./segfault2.t
<testsuites failures="0" errors="0" tests="1">
<testsuite failures="0"
errors="1"
tests="1"
name="linux_segfault2_t">
<system-out><![CDATA[1..1
ok
]]></system-out>
<system-err><![CDATA[Non-zero wait status: 139
]]></system-err>
<error message="Non-zero wait status: 139" />
</testsuite>
</testsuites>