GNU bug report logs - #28333
26.0.50; Backtrace not printed when ERT test fails

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Sat, 2 Sep 2017 19:22:01 UTC

Severity: normal

Tags: confirmed, fixed, patch

Found in version 26.0.50

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Gemini Lasswell <gazally <at> runbox.com>
Cc: 28333 <at> debbugs.gnu.org
Subject: Re: bug#28333: 26.0.50; Backtrace not printed when ERT test fails
Date: Sat, 2 Sep 2017 17:28:51 -0400
tag 28333 confirmed
quit

On Sat, Sep 2, 2017 at 3:20 PM, Gemini Lasswell <gazally <at> runbox.com> wrote:
> ERT used to print a backtrace for every failed test, but recently that
> stopped happening. I git bisected and found that the commit which
> introduced the problem is ead545824e, "Improve ert backtrace
> recording".

Hah, ironic isn't it. The problem is this code here:

              ;; Grab the frames starting from `signal', frames below
              ;; that are all from the debugger.
              (backtrace (backtrace-frames 'signal))

When the error comes from division by 0, there is `signal' frame at
all, hence we store `nil' as the backtrace. Maybe this could be fixed
with something equivalent to the following?

--- i/lisp/emacs-lisp/ert.el
+++ w/lisp/emacs-lisp/ert.el
@@ -739,7 +739,8 @@ ert--run-test-debugger
               ;;
               ;; Grab the frames starting from `signal', frames below
               ;; that are all from the debugger.
-              (backtrace (backtrace-frames 'signal))
+              (backtrace (or (backtrace-frames 'signal)
+                             (cdr (backtrace-frames 'ert--run-test-debugger))))
               (infos (reverse ert--infos)))
          (setf (ert--test-execution-info-result info)
                (cl-ecase type




This bug report was last modified 7 years and 235 days ago.

Previous Next


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