Re: bailing out in tap tests nearly always a bad idea - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: bailing out in tap tests nearly always a bad idea
Date
Msg-id d3d66aa9-422a-7dc9-0105-e3a679c9b849@dunslane.net
Whole thread Raw
In response to Re: bailing out in tap tests nearly always a bad idea  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2/14/22 12:58, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
>> Even just getting rid of the "Tests were run but no plan was declared and
>> done_testing() was not seen." noise would be helpful. So I think using a fatal
>> error routine that forced a failure to be recognized via ok(0, 'fatal error')
>> and then does done_testing() would be better...
> Maybe we could do something in an END block provided by Utils.pm?
> I still think that insisting that people avoid die() is going to
> be annoying.
>
>             


See references to $SIG{__DIE__} in `perldoc-f die` and `perldoc perlvar`
for how to set up a handler for die() cleanup. Maybe we could set up a
handler that calls done_testing(). ?


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: do only critical work during single-user vacuum?
Next
From: Ashutosh Sharma
Date:
Subject: Re: Make mesage at end-of-recovery less scary.