From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#47320: Improve failure reporting in test/lisp/electrict-tests.el Date: Wed, 24 Mar 2021 19:42:54 +0000 Message-ID: References: <87v99i5k0f.fsf@gmx.de> <877dlx3nb8.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17781"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Albinus , 47320-done@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 24 20:44:37 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lP9Qj-0004Wo-Pn for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Mar 2021 20:44:37 +0100 Original-Received: from localhost ([::1]:58522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP9Qi-0007Wj-Q9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Mar 2021 15:44:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP9QA-0007WU-FJ for bug-gnu-emacs@gnu.org; Wed, 24 Mar 2021 15:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP9QA-0002Ge-5L for bug-gnu-emacs@gnu.org; Wed, 24 Mar 2021 15:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lP9QA-0002nf-2i for bug-gnu-emacs@gnu.org; Wed, 24 Mar 2021 15:44:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Mar 2021 19:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 47320 X-GNU-PR-Package: emacs Mail-Followup-To: 47320@debbugs.gnu.org, acm@muc.de, acm@muc.de Original-Received: via spool by 47320-done@debbugs.gnu.org id=D47320.161661498310653 (code D ref 47320); Wed, 24 Mar 2021 19:44:01 +0000 Original-Received: (at 47320-done) by debbugs.gnu.org; 24 Mar 2021 19:43:03 +0000 Original-Received: from localhost ([127.0.0.1]:36126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lP9PD-0002lk-DS for submit@debbugs.gnu.org; Wed, 24 Mar 2021 15:43:03 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:48298 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1lP9PB-0002l9-UB for 47320-done@debbugs.gnu.org; Wed, 24 Mar 2021 15:43:02 -0400 Original-Received: (qmail 22445 invoked by uid 3782); 24 Mar 2021 19:42:55 -0000 Original-Received: from acm.muc.de (p4fe15b2f.dip0.t-ipconnect.de [79.225.91.47]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 24 Mar 2021 20:42:54 +0100 Original-Received: (qmail 28584 invoked by uid 1000); 24 Mar 2021 19:42:54 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202962 Archived-At: Hello again, Joćo. On Wed, Mar 24, 2021 at 14:02:58 +0000, Joćo Tįvora wrote: > On Wed, Mar 24, 2021 at 1:46 PM Alan Mackenzie wrote: > > I'm having some difficulty getting my head around the "explanation" > > functionality of ert, which leans me towards my initial plan. > > Here's the patch (actually written quite a long time ago) I would like to > > merge into electric-tests.el: > As far as I understand, this just stores the big explanation string in > a variable, and uses it both for putting into the `ert-deftest` 's docstring > as well as for logging with message(), right? If so, it's fine to add. > Maybe you could leverage `ert-fail` instead of checking the test's > main assertion twice, once in should, and once when deciding > whether to log. In the end, I couldn't get that to work - the handler for the signal, in outputting the doc string, replaced all the \n's with the octal read-syntax, "\\12". This left the text readable only with effort. > I'd say, just check it once and put both logging and `ert-fail` inside the if. I just committed the patch as it was. Sorry. > Joćo -- Alan Mackenzie (Nuremberg, Germany).