GNU bug report logs - #51037
[PATCH] Make `print-level` & `print-length` customizable in ERT batch tests

Previous Next

Package: emacs;

Reported by: Michael <sp1ff <at> runbox.com>

Date: Tue, 5 Oct 2021 14:51:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael <sp1ff <at> runbox.com>, Eli Zaretskii <eliz <at> gnu.org>, 51037 <at> debbugs.gnu.org, gazally <at> runbox.com
Subject: bug#51037: [PATCH] Make `print-level` & `print-length` customizable in ERT batch tests
Date: Wed, 17 Nov 2021 19:22:08 +0300
On 16/11/2021 08:48 +0100, Lars Ingebrigtsen wrote:

> Michael <sp1ff <at> runbox.com> 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)




This bug report was last modified 3 years and 172 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.