X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Ftest-lib.el;fp=test%2Ftest-lib.el;h=15271b02f2fb94080288f0e0efbb40d747c5d104;hp=b47b388e018846815a761cf681c4203f326446ff;hb=d5d8846c3286ec681c3d46b3fe30d50254224208;hpb=a2e9eaadaf2728bb09064b274744f930581e443e diff --git a/test/test-lib.el b/test/test-lib.el index b47b388e..15271b02 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -22,6 +22,12 @@ (require 'cl-lib) +;; Ensure that the dynamic variables that are defined by this library +;; are defined by the time that we let-bind them. This is needed +;; because starting with Emacs 27 undeclared variables in evaluated +;; interactive code (such as our tests) use lexical scope. +(require 'smtpmail) + ;; `read-file-name' by default uses `completing-read' function to read ;; user input. It does not respect `standard-input' variable which we ;; use in tests to provide user input. So replace it with a plain @@ -113,6 +119,12 @@ nothing." (add-hook-counter 'notmuch-hello-mode-hook) (add-hook-counter 'notmuch-hello-refresh-hook) +(defvar notmuch-hello-mode-hook-counter -100 + "Tests that care about this counter must let-bind it to 0.") + +(defvar notmuch-hello-refresh-hook-counter -100 + "Tests that care about this counter must let-bind it to 0.") + (defadvice notmuch-search-process-filter (around pessimal activate disable) "Feed notmuch-search-process-filter one character at a time." (let ((string (ad-get-arg 1)))