mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
test/emacs: provide macro test-log-error
Because of the way emacs reports errors, a test form can crash and not change the main buffer. To work around this, capture both signalled errors and any other messages.
This commit is contained in:
parent
7556bb7da2
commit
59d0d5a489
1 changed files with 12 additions and 0 deletions
|
@ -174,6 +174,18 @@ running, quit if it terminated."
|
|||
" "))
|
||||
tags-to-letters ""))))
|
||||
|
||||
;; Log any signalled error (and other messages) to MESSAGES
|
||||
;; Log "COMPLETE" if forms complete without error.
|
||||
(defmacro test-log-error (&rest body)
|
||||
`(progn
|
||||
(with-current-buffer "*Messages*"
|
||||
(let ((inhibit-read-only t)) (erase-buffer)))
|
||||
(condition-case err
|
||||
(progn ,@body
|
||||
(message "COMPLETE"))
|
||||
(t (message "%s" err)))
|
||||
(with-current-buffer "*Messages*" (test-output "MESSAGES"))))
|
||||
|
||||
;; For historical reasons, we hide deleted tags by default in the test
|
||||
;; suite
|
||||
(setq notmuch-tag-deleted-formats
|
||||
|
|
Loading…
Reference in a new issue