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 #16 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, 23 Sep 2017 11:48:38 -0400
[Message part 1 (text/plain, inline)]
tags 28333 + patch
quit

Gemini Lasswell <gazally <at> runbox.com> 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:

[0001-Fix-ert-backtrace-saving-for-non-signal-ed-errors-Bu.patch (text/x-diff, inline)]
From 847ed811022f4d4fe43f2d5e14660f93538423dd Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Sat, 23 Sep 2017 11:40:14 -0400
Subject: [PATCH] Fix ert backtrace saving for non-`signal'ed errors
 (Bug#28333)

* 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
-- 
2.11.0


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

Previous Next


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