Subject: bug#51037: [PATCH] Make `print-level` & `print-length` customizable in ERT batch tests

From: Andy Moreton <[email-masked]>
Date: Thu, 07 Oct 2021 22:04:33 +0100

On Thu 07 Oct 2021, Lars Ingebrigtsen wrote:

> Eli Zaretskii <[email-masked]> writes:
>
>> Why do we limit print-length in batch mode?  In interactive session,
>> one can click or type RET on the ellipsis and get it expanded, but no
>> such joy in batch.  See
>>
>>   https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00395.html
>>
>> for how that makes debugging more difficult than it has to be.
>>
>> So how about using huge values in batch?  Are there any downsides?
>
> It'll make the error summaries completely unreadable, which isn't what
> you want when doing a "make check" -- you just want to see that there's
> a problem and where it is.  (Well, at least I do.)
>
> But when making a specific test (i.e., "make subr-tests" etc) it would
> indeed be nice to have untruncated backtraces.  I think adding these new
> variables would allow us to do this.

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).

    AndyM