From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.bugs Subject: bug#51037: [PATCH] Make `print-level` & `print-length` customizable in ERT batch tests Date: Wed, 17 Nov 2021 19:22:08 +0300 Message-ID: References: <86tuhvmtpl.fsf@runbox.com> <877deqec10.fsf@gnus.org> <83fste2u4i.fsf@gnu.org> <87ily94662.fsf@gnus.org> <83fstd1bth.fsf@gnu.org> <87czogslm4.fsf@gnus.org> <86ily2mjtq.fsf@runbox.com> <87r1cp89o4.fsf@gnus.org> <86fst5m48v.fsf@runbox.com> <87a6jd5891.fsf@gnus.org> <86mtmykxro.fsf@runbox.com> <87y26hz24c.fsf@gnus.org> <86bl3blcgm.fsf@runbox.com> <87wnlya9sj.fsf@gnus.org> <86wnlbmooj.fsf@runbox.com> <87fsry7qdy.fsf@gnus.org> <87bl2m7q9g.fsf@gnus.org> <86zgq5kn9y.fsf@runbox.com> <87ilws7d7e.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6960"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: Michael , gazally@runbox.com, 51037@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 17 17:25:34 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 1mnNka-0001YM-Jw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Nov 2021 17:25:33 +0100 Original-Received: from localhost ([::1]:37640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnNkZ-0006es-Ae for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Nov 2021 11:25:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnNiB-0004NY-8v for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2021 11:23:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnNiB-0006Jv-0C for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2021 11:23:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnNiA-0005Km-D4 for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2021 11:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Nov 2021 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51037 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51037-submit@debbugs.gnu.org id=B51037.163716614420419 (code B ref 51037); Wed, 17 Nov 2021 16:23:02 +0000 Original-Received: (at 51037) by debbugs.gnu.org; 17 Nov 2021 16:22:24 +0000 Original-Received: from localhost ([127.0.0.1]:33621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnNhX-0005JH-M7 for submit@debbugs.gnu.org; Wed, 17 Nov 2021 11:22:23 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnNhR-0005Iv-O1 for 51037@debbugs.gnu.org; Wed, 17 Nov 2021 11:22:22 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 656185C00E6; Wed, 17 Nov 2021 11:22:12 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 17 Nov 2021 11:22:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm1; bh=NINwfmJLZ4eh9FMCdfJzOILDsr qdsoQfe4PR8bZthzY=; b=BGuZbMSZy08734/AOqmg8RfnrK8RgSKRYbiaJN+IoV 7QKy3BoUVpbq2X5c8qqoobUjuACj0pHglHyZRsJwkqkBLMm4Hxx4x1TtDRIczAqV 5SwHSRssoLng9uM2j4N6Z9ATVxmM/BiXzvMV3bKx+CcljEjPxwFfgNnrapFV2bgZ MAIxEH/vfQgL23mlvJJ0GiBmh+zfvqpjfHWpV3RM5m1m3i7MTAohFPLtLCQMNpfw 1ohMXslEBskwBTU2xUKQY2F1Zyp4vJZS7a1M4nSIFF90swpTVZA8JZ0pqtNQyH6W u4IeZzcKTFjgxZBj8okwzxkQqWlizRKrbH6vwrJqVzYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=NINwfm JLZ4eh9FMCdfJzOILDsrqdsoQfe4PR8bZthzY=; b=CP6e4IcQaf1lsApoBbKyVQ yKJvJPBTy6MUJgHRKfZ5aL00r5CAxopK7e1WQS0gZCZsjlLtYxk3WGqKQgZbOi5Y yveDYib0srSQcJpnJkEB1GXOLx5QvAAtj+Syfmo9dW6gTlxPoqYLoubJCYIIz1RJ olsUOoiFbG3ao7SSNx6C6TxuM5iuJaBuu14UfkNlPAYfDCdo5pjJY9Qpd6dh1P9F zhGg80si5hKRO7agvJ9tw1uFMf7yo5FM4ICUZlJtDUoIykwKXI/NAkUNxbJhM5Ym 2osZ6l2E5YS+9P0uVZdKg35H1z+bR9WCeR9LP6/U+6CRgXofEEf0Qqdf7ALiEHAQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeeggdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhiphhp ucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtffrrg htthgvrhhnpefhieehteekudegvdefkedvveduteevieeukeetuefffeekffdvleeihedu ffeljeenucffohhmrghinhepihhnghgvsghrihhgthhsvghnrdhnohenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghs thhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Nov 2021 11:22:10 -0500 (EST) In-Reply-To: <87ilws7d7e.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 16 Nov 2021 08:48:53 +0100") 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:220219 Archived-At: On 16/11/2021 08:48 +0100, Lars Ingebrigtsen wrote: > Michael writes: > >> New patch attached. Incorporates (I hope) these changes, as well >> as addresses Eli's issues. > > Thanks; applied to Emacs 29 with some minor changes. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no I've got this fixup patch for this, below. Mainly this fixes `ert' interactive spec, where there was a leftover second argument, nil. However I'm not quite sure in this docstring fix: -mode. A value of nil will short-circuit this mechanism; line -lengths will be completely determined by `ert-batch-line-length' -and `ert-batch-line-level'. Any other value will be temporarily The docstring for backtrace-line-length says: "If set to nil or zero, backtrace mode will not abbreviate the forms it prints." So the above sentence, which I removed, was indeed not true? (a quick look over its usages confirmed that to me, but I'd like someone else to check) Thanks. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 36b4408dc8..7f9b7b22c7 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -101,12 +101,10 @@ ert-batch-backtrace-line-length forming them. This variable governs the target maximum line length by manipulating these two variables while printing stack traces. Setting this variable to t will re-use the value of -`backtrace-line-length' while print stack traces in ERT batch -mode. A value of nil will short-circuit this mechanism; line -lengths will be completely determined by `ert-batch-line-length' -and `ert-batch-line-level'. Any other value will be temporarily -bound to `backtrace-line-length' when producing stack traces -in batch mode.") +`backtrace-line-length' while printing stack traces in ERT batch +mode. Any other value will be temporarily bound to +`backtrace-line-length' when producing stack traces in batch +mode.") (defface ert-test-result-expected '((((class color) (background light)) :background "green1") @@ -1447,8 +1445,6 @@ ert-run-tests-batch (cond ((eq ert-batch-backtrace-line-length t) backtrace-line-length) - ((eq ert-batch-backtrace-line-length nil) - nil) (t ert-batch-backtrace-line-length))) (print-level ert-batch-print-level) @@ -2055,8 +2051,7 @@ ert-run-tests-interactively (read (completing-read (format-prompt "Run tests" default) obarray #'ert-test-boundp nil nil - 'ert--selector-history default nil))) - nil)) + 'ert--selector-history default nil))))) (let (buffer listener) (setq listener (lambda (event-type &rest event-args)