pgsql: perl tap: Show die reason in TAP output

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: perl tap: Show die reason in TAP output
Date: 2026-04-02 12:25:39
Message-ID: E1w8H7D-002bgV-01@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

perl tap: Show die reason in TAP output

Install a $SIG{__DIE__} handler in the INIT block of Utils.pm that emits
the die message as a TAP diagnostic. Previously, an unexpected die
(e.g. from safe_psql) produced only "no plan was declared" with no
indication of the actual error. The handler also calls done_testing()
to suppress that confusing message.

Dies during compilation ($^S undefined) and inside eval ($^S == 1) are
left alone.

Author: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Reviewed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reviewed-by: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Reviewed-by: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/DFYFWM053WHS.10K8ZPJ605UFK@jeltef.nl
Discussion: https://postgr.es/m/20220222181924.eehi7o4pmneeb4hm%40alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/76540fdedf405c01518007bef3bdd96e0b96d390

Modified Files
--------------
src/test/perl/PostgreSQL/Test/Utils.pm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2026-04-02 12:46:16 pgsql: Check for __cpuidex and __get_cpuid_count separately
Previous Message Tomas Vondra 2026-04-02 11:47:43 pgsql: jit: Change the default to off.