public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andres Freund <[email protected]>
To: Daniel Gustafsson <[email protected]>
To: Nikolay Shaplov <[email protected]>
Cc: Dagfinn Ilmari Mannsåker <[email protected]>
Cc: PostgreSQL Developers <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Subject: Re: TAP output format in pg_regress
Date: Thu, 24 Nov 2022 11:32:35 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<1787166.pFkNfHHBAF@thinkpad-pgpro>
<[email protected]>
On November 24, 2022 11:07:43 AM PST, Daniel Gustafsson <[email protected]> wrote:
>> On 24 Nov 2022, at 18:07, Nikolay Shaplov <[email protected]> wrote:
>One option could be to redefine bail() to take the exit function as a parameter
>and have the caller pass the preferred exit handler.
>
>-bail_out(bool non_rec, const char *fmt,...)
>+bail(void (*exit_func)(int), const char *fmt,...)
>
>The callsites would then look like the below, which puts a reference to the
>actual exit handler used in the code where it is called.
I'd just rename _bail to bail_noatexit().
>> This magic spell "...%-5i %s%-*s %8.0f ms\n" is too dark to repeat it even two
>> times. I understand problems with spaces... But may be it would be better
>> somehow narrow it to one ugly print... Print "ok %-5i "|"not ok %-5i" to
>> buffer first, and then have one "%s%-*s %8.0f ms%s\n" print or something like
>> that...
>
>I'm not convinced that this printf format is that hard to read (which may well
>be attributed to Stockholm Syndrome), and I do think that breaking it up and
>adding more code to print the line will make it less readable instead.
I don't think it's terrible either. I do think it'd also be ok to switch between ok / not ok within a single printf, making it easier to keep them in sync.
Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
view thread (40+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: TAP output format in pg_regress
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox