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


Message #31 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Moreton <andrewjmoreton <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
Date: Fri, 08 Oct 2021 14:49:37 +0100
On Fri 08 Oct 2021, Lars Ingebrigtsen wrote:

> Andy Moreton <andrewjmoreton <at> gmail.com> writes:
>
>> Isn't that what ert-batch-backtrace-right-margin is for ?
>>
>>   (defcustom ert-batch-backtrace-right-margin 70
>>     "Maximum length of lines in ERT backtraces in batch mode.
>>   Use nil for no limit (caution: backtrace lines can be very long)."
>>     :type '(choice (const :tag "No truncation" nil) integer))
>>
>> Also the TEST_BACKTRACE_LINE_LENGTH environment variable can be
>> used to set it (see test/Makefile.in).
>
> Right.  But ert will still shorten "internally" with print-length etc
> before chopping the lines to 70 characters.  Here's with a longer value:
>
> est test-ensure-list2 backtrace:
>   signal(error ("(\"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"..."))
>   error("%S" ("foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" ...))
>   (closure (t) nil (error "%S" (make-list 100 "foo")))()
>
> Note the "..." at the end of the foo list -- that's from print-length.


Good point. The truncation would not be so bothersome if there were
separate console and logfile streams (with the truncation only happening
in the console stream, and the full details in the logfile stream).

Anything that can make failed tests easier to diagnose is a useful
improvement.

    AndyM





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

Previous Next


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