Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How can I write Test::Finished?

by schwern (Scribe)
on Jun 22, 2004 at 19:53 UTC ( [id://368834]=note: print w/replies, xml ) Need Help??


in reply to How can I write Test::Finished?

Overriding CORE::exit() is probably the simplest thing to do, I'm planning on building that into Test::More once I'm convinced there's a real need. POSIX::_exit() is another one. Override them so they set a flag and check for that flag in an END block (END blocks are still run even when exit()ing).

I don't think there's anything you can do about a direct call to CORE::exit() but that's about as unlikely as they come.

Filters are just asking for trouble.

I've never run into this problem in the real world so I'm less than convinced it needs addressing. Has an exit(0) bitten anyone else?

-- Michael G Schwern

Replies are listed 'Best First'.
Re^2: How can I write Test::Finished?
by samtregar (Abbot) on Jun 22, 2004 at 20:57 UTC
    That sounds reasonable and it's probably the easiest thing that could possibly work.

    BTW, how come exit(1) gets ignored by Test::Harness? I've got this in bad.t:

    use Test::More qw(no_plan); ok(1); exit(1); ok(1);

    But when I run a make test:

    $ make test PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/ +local/lib/perl5/5.6.1/i686-linux -I/usr/local/lib/perl5/5.6.1 -e 'use + Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t +/*.t t/bad....ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 cusr + 0.01 csys = 0.03 + CPU)

    What gives? I've got Test::Harness v2.32 and Test::More v0.47.

    -sam

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://368834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found