1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Add tests for remote files in auto-revert-tests

* lisp/autorevert.el (auto-revert-debug): New defvar.
(auto-revert-notify-handler): Write traces.

* lisp/filenotify.el (file-notify-debug): New defvar.
(file-notify-handle-event, file-notify-callback): Write traces.

* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered):
Handle nil `vc-handled-backends'.

* test/lisp/autorevert-tests.el
(auto-revert-test-remote-temporary-file-directory): New defconst.
Handle also $REMOTE_FILE_NOTIFY_LIBRARY.
(auto-revert--test-enabled-remote-checked): New defvar.
(auto-revert--test-enabled-remote): New defun.
(auto-revert--wait-for-revert): Rewrite without timeout.
(auto-revert--deftest-remote): New defmacro.
(auto-revert-test01-auto-revert-several-files):
(auto-revert-test02-auto-revert-deleted-file): Adapt for remote files.
(auto-revert-test02-auto-revert-deleted-file):
Use `auto-revert-debug' for debug messages.
(auto-revert-test00-auto-revert-mode-remote)
(auto-revert-test01-auto-revert-several-files-mode-remote)
(auto-revert-test02-auto-revert-deleted-file-mode-remote)
(auto-revert-test03-auto-revert-tail-mode-mode-remote)
(auto-revert-test04-auto-revert-mode-dired-mode-remote): New tests.

* test/lisp/filenotify-tests.el (file-notify--test-event-handler):
Use `file-notify-debug' for debug messages.
This commit is contained in:
Michael Albinus 2019-05-03 17:18:13 +02:00
parent 24a1d5a0b5
commit d0fe28cb1d
5 changed files with 231 additions and 99 deletions

View file

@ -30,6 +30,9 @@
(require 'cl-lib)
(eval-when-compile (require 'subr-x))
(defvar file-notify-debug nil
"Use for debug messages.")
(defconst file-notify--library
(cond
((featurep 'inotify) 'inotify)
@ -93,7 +96,8 @@ If EVENT is a filewatch event, call its callback. It has the format
Otherwise, signal a `file-notify-error'."
(interactive "e")
;;(message "file-notify-handle-event %S" event)
(when file-notify-debug
(message "file-notify-handle-event %S" event))
(if (and (consp event)
(eq (car event) 'file-notify)
(>= (length event) 3))
@ -242,11 +246,12 @@ EVENT is the cadr of the event in `file-notify-handle-event'
(string-equal
(file-notify--watch-filename watch)
(file-name-nondirectory file1)))))
;;(message
;;"file-notify-callback %S %S %S %S %S %S %S"
;;desc action file file1 watch
;;(file-notify--event-watched-file event)
;;(file-notify--watch-directory watch))
(when file-notify-debug
(message
"file-notify-callback %S %S %S %S %S %S %S"
desc action file file1 watch
(file-notify--event-watched-file event)
(file-notify--watch-directory watch)))
(funcall (file-notify--watch-callback watch)
(if file1
`(,desc ,action ,file ,file1)