[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28333: 26.0.50; Backtrace not printed when ERT test fails

From: Noam Postavsky
Subject: bug#28333: 26.0.50; Backtrace not printed when ERT test fails
Date: Sat, 23 Sep 2017 11:48:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux)

tags 28333 + patch

Gemini Lasswell <address@hidden> writes:

> Noam Postavsky writes:
>> Maybe this could be fixed with something equivalent to the following?
> I've been running this for a few days and haven't seen any more missing
> backtraces.

Actually, I think it's giving one extra frame.  Using `debugger' as the
BASE seems to cover both cases nicely:

>From 847ed811022f4d4fe43f2d5e14660f93538423dd Mon Sep 17 00:00:00 2001
From: Noam Postavsky <address@hidden>
Date: Sat, 23 Sep 2017 11:40:14 -0400
Subject: [PATCH] Fix ert backtrace saving for non-`signal'ed errors

* lisp/emacs-lisp/ert.el (ert--run-test-debugger): Take the frames
above the `debugger' frame, rather than assuming there will be a
`signal' frame.
 lisp/emacs-lisp/ert.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index d4276221ba..83acbacb88 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -742,9 +742,8 @@ ert--run-test-debugger
               ;; backtrace ready for printing is important for batch
               ;; use.
-              ;; Grab the frames starting from `signal', frames below
-              ;; that are all from the debugger.
-              (backtrace (backtrace-frames 'signal))
+              ;; Grab the frames above the debugger.
+              (backtrace (cdr (backtrace-frames debugger)))
               (infos (reverse ert--infos)))
          (setf (ert--test-execution-info-result info)
                (cl-ecase type

reply via email to

[Prev in Thread] Current Thread [Next in Thread]