Subject: bug#50629: 28.0.50; hard to debug an uncaught error with ert

From: Gerd Möllmann <[email-masked]>
Date: Sat, 27 Aug 2022 16:06:14 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> Gerd Möllmann <[email-masked]> writes:
>
>> The backtrace we have already.  It's the "unreadable" stuff that ERT
>> prints.
>
> No, that's not the backtrace (that we're interested in).
>
> With this example:
>
> emake; ./src/emacs -Q -batch -l ert -eval '(ert-deftest f () (setq
> debug-on-error t) (defun foo () (bar)) (defun bar () (zot)) (should
> (equal 42 (foo))))' -f ert-run-tests-batch-and-exit
>
> We'd like to see a backtrace that mentions that zot was called by bar,
> and that bar was called by foo.  Instead we get:
>
> Test f backtrace:
>   signal(void-function (zot))
>   apply(signal (void-function (zot)))
>   (setq value-2 (apply fn-0 args-1))
>   (unwind-protect (setq value-2 (apply fn-0 args-1)) (setq form-descri
>
> Note that there's no mention of foo or bar.

That's what I meant with macrology.  Please macroexpand and look at
what's actually executed.