Skip to content

Commit

Permalink
Do not print stacktraces for certain file load errors
Browse files Browse the repository at this point in the history
The stacktraces for buttercup-dynamic-binding-error and end-of-file
are not interesting.
  • Loading branch information
snogge committed Mar 7, 2024
1 parent 9bb93d5 commit 64dc81a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ current directory."
(setq args (cdr args)))))
(setq command-line-args-left nil)
(setq failed-files-suite (make-buttercup-suite
:description "File failed to load completely: "))
:description "File failed to load correctly:"))
(dolist (dir (or dirs '(".")))
(dolist (file (directory-files-recursively
dir "\\`test-.*\\.el\\'\\|-tests?\\.el\\'"))
Expand All @@ -1554,9 +1554,12 @@ spec and add it to FAILURE-SUITE."
(cl-destructuring-bind (status description stack)
(buttercup--funcall #'load file nil t)
(when (eq status 'failed)
(if (memq (caadr description)
'(buttercup-dynamic-binding-error end-of-file))
(setq stack nil)
;; Skip all of stack until load is called
(while (not (eq (nth 1 (car stack)) 'load))
(pop stack))
(pop stack)))
(buttercup-suite-add-child
failure-suite
(make-buttercup-spec
Expand Down

0 comments on commit 64dc81a

Please sign in to comment.