emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/buttercup f515f8f95b 1/2: Prevent early backtrace on test


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup f515f8f95b 1/2: Prevent early backtrace on test failure
Date: Tue, 29 Mar 2022 16:57:58 -0400 (EDT)

branch: elpa/buttercup
commit f515f8f95b42770880c7f548d385da10a71682e9
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    Prevent early backtrace on test failure
    
    The buutercup finctions called from the commandline uses error to make
    Emacs return a non-zero exit code.  This will trigger early backtrace,
    which is not useful to buttercup.  Disable it by setting
    backtrace-on-error-noninteractive at the start of these functions.
    
    It could be that backtrace-on-error-noninteractive should be set just
    before the error is signaled, but then it is hard to decide whether
    this is a commandline batch run.
    
    Fixes #214.
---
 buttercup-compat.el | 5 +++++
 buttercup.el        | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/buttercup-compat.el b/buttercup-compat.el
index 792a8c8d1f..4da8e106e8 100644
--- a/buttercup-compat.el
+++ b/buttercup-compat.el
@@ -119,7 +119,12 @@ This is the time of the last change to the file's 
contents, and
 is a Lisp timestamp in the style of `current-time'."
        (nth 5 attributes)))
 
+;;;;;;;;;;;;;;;;;;;;;
+;; Introduced in 29.1
 
+(unless (boundp 'backtrace-on-error-noninteractive)
+  (defvar backtrace-on-error-noninteractive nil
+       "Control eacrly backtrace starting in Emacs 29."))
 
 (provide 'buttercup-compat)
 ;;; buttercup-compat.el ends here
diff --git a/buttercup.el b/buttercup.el
index 5fa482ec8d..7fd00b3b95 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1371,6 +1371,7 @@ spec, and should be killed after running the spec.")
 
 Takes directories as command line arguments, defaulting to the
 current directory."
+  (setq backtrace-on-error-noninteractive nil)
   (let ((dirs nil)
         (patterns nil)
         (args command-line-args-left))
@@ -1483,6 +1484,7 @@ If MARKDOWN-BUFFERS is empty (nil), use the current 
buffer."
 (defun buttercup-run-markdown ()
   "Run all test suites defined in Markdown files passed as arguments.
 A suite must be defined within a Markdown \"lisp\" code block."
+  (setq backtrace-on-error-noninteractive nil)
   (apply #'buttercup-run-markdown-buffer (mapcar #'find-file-noselect
                                                  command-line-args-left)))
 



reply via email to

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