in reply to $SIG{__DIE__} overrides exit status?

$SIG{__DIE__} = sub { $! = $real_exit_code; die @_ };

Replies are listed 'Best First'.
Re^2: $SIG{__DIE__} overrides exit status?
by Ovid (Cardinal) on Oct 17, 2007 at 13:25 UTC

    Test::Harness doesn't have control over the signal handlers that the tested code might implement. When you install Class::Does::Everything via cpan or cpanplus, you can't just expect they've written it correctly.

    What we could do is have the test programs invoked like this:

      perl -MTest::Harness::SIGDIE t/some_test.t

    Then we'd just have to figure out the Test::Harness::SIGDIE magic. Actually, now that I stop to think about it, that might not work either. It still requires the signal handler to be written correctly.

    Cheers,
    Ovid

    New address of my CGI Course.

      Test::Harness doesn't have control over the signal handlers that the tested code might implement.

      Ah, sorry; I misunderstood the situation.