Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyHxs-0000hH-Vy for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Nov 2022 19:32:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oyHxr-000877-Ph for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Nov 2022 19:32:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyHxr-00086x-Ga for pgsql-hackers@lists.postgresql.org; Thu, 24 Nov 2022 19:32:51 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyHxk-00041Q-3e for pgsql-hackers@lists.postgresql.org; Thu, 24 Nov 2022 19:32:50 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 10A0B5C0154; Thu, 24 Nov 2022 14:32:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 24 Nov 2022 14:32:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1669318360; x= 1669404760; bh=Ff6lJ30WBwmN2jZTWkfxdyTHWDd2YBlRg9lxJoEhru8=; b=j c1VlP81hSxEEVsFsdLxgXiOyYrd69PVf8xMv5PjTbgcypj+tYz9c+fn9B6wWY9AP vEeSI9G+QL76ojhT/AHznYFZlFXRCdXJouz5atkNV0GoMC/83qwvVCs3oNJNyvCu t6eMuyXfVmZ+mj1kL/NlX+XeeLUJwQC3ypQY/BGtMi1/5DiX8mX7VQAnzxGL+SY8 BNPUU7F7GuapXbzS6kMcy01QTqyPG8+EAmbw695ax/ScNUgEIbbyUhfhakmN0O83 HkX62EPB6q28C2Mssb4nk/igAMWeCTzZJmmST1GTe+YtmF/mcEZiTuKA5q9d+7WW BAodBUxEsE7sUuIEJ5QMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1669318360; x= 1669404760; bh=Ff6lJ30WBwmN2jZTWkfxdyTHWDd2YBlRg9lxJoEhru8=; b=l G7kbsXag14nBEDEDPfUtcdpyPIbOQDt9cAEZU32o7FinxiICIPCfs9KKCNLyC7IC 0s0VJ764vUVkXTHde5T2+9iSUjzX1D7cJWl8trRLJ26SJKFLN2E5wuwIeIz0ojeL lqGBcA8AC8RPOOi05ihMkRliFTe3THm5ioKvx0vk87Nt5T6S6ZtbapucItnYA/vv L7dFjzDNdZTgtUO+Q5Sz0b7H0eTroYcwfZtcFt/73YvyR8RT+EoId+X6d/7l1D61 ves1E/dDprpHV5C6jZMlPRFPA7E36oM3FwsOqaU9Td2Lynmi8knnkhczfq9HtSlp biDX0x17vCma/JpctXAVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieefgdduvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdliedmnecujfgurhepfffhvfevufgfjghfkfggtgfgsehtqhhmtddt reejnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrh griigvlhdruggvqeenucggtffrrghtthgvrhhnpefhgfekheettdegveevtddthfelueeh jedvteevfffhgfejudeigeejgeekiedtffenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Nov 2022 14:32:38 -0500 (EST) Date: Thu, 24 Nov 2022 11:32:35 -0800 From: Andres Freund To: Daniel Gustafsson , Nikolay Shaplov CC: =?ISO-8859-1?Q?Dagfinn_Ilmari_Manns=E5ker?= , PostgreSQL Developers , Andrew Dunstan , Tom Lane , Peter Eisentraut Subject: Re: TAP output format in pg_regress User-Agent: K-9 Mail for Android In-Reply-To: <3F201049-250A-4BE4-9365-36A840C162E3@yesql.se> References: <5e6bc6a6-0a4e-109d-2b7d-c286dc58d609@enterprisedb.com> <20221122235636.4frx7hjterq6bmls@awork3.anarazel.de> <1787166.pFkNfHHBAF@thinkpad-pgpro> <3F201049-250A-4BE4-9365-36A840C162E3@yesql.se> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On November 24, 2022 11:07:43 AM PST, Daniel Gustafsson wrote: >> On 24 Nov 2022, at 18:07, Nikolay Shaplov wrote: >One option could be to redefine bail() to take the exit function as a par= ameter >and have the caller pass the preferred exit handler=2E > >-bail_out(bool non_rec, const char *fmt,=2E=2E=2E) >+bail(void (*exit_func)(int), const char *fmt,=2E=2E=2E) > >The callsites would then look like the below, which puts a reference to t= he >actual exit handler used in the code where it is called=2E I'd just rename _bail to bail_noatexit()=2E >> This magic spell "=2E=2E=2E%-5i %s%-*s %8=2E0f ms\n" is too dark to rep= eat it even two=20 >> times=2E I understand problems with spaces=2E=2E=2E But may be it would= be better=20 >> somehow narrow it to one ugly print=2E=2E=2E Print "ok %-5i "|"not o= k %-5i" to=20 >> buffer first, and then have one "%s%-*s %8=2E0f ms%s\n" print or someth= ing like=20 >> that=2E=2E=2E > >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=2E I don't think it's terrible either=2E 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=2E Andres --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E