Commit f82e0e5b authored by Michael Albinus's avatar Michael Albinus

Adapt tests for recent file-notification changes in Tramp

* lisp/net/tramp.el (tramp-file-notify-process-sentinel):
Pacify byte compiler.

* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Adapt for remote
files.
parent ab642288
Pipeline #1568 failed with stage
in 60 minutes and 16 seconds
......@@ -3859,7 +3859,7 @@ of."
"Call `file-notify-rm-watch'."
(unless (process-live-p proc)
(tramp-message proc 5 "Sentinel called: `%S' `%s'" proc event)
(file-notify-rm-watch proc)))
(tramp-compat-funcall 'file-notify-rm-watch proc)))
;;; Functions for establishing connection:
......
......@@ -309,9 +309,7 @@ This expects `auto-revert--messages' to be bound by
;; polling.
(should (string-match "any text" (buffer-string)))
;; With w32notify, the 'stopped' events are not sent.
;; Same for remote file name handlers. Why?
(or (eq file-notify--library 'w32notify)
(file-remote-p temporary-file-directory)
(should-not auto-revert-notify-watch-descriptor))
;; Once the file has been recreated, the buffer shall be
......
......@@ -682,17 +682,18 @@ delivered."
(file-notify--test-library) "gvfs-monitor-dir.exe")
'((deleted stopped)
(created deleted stopped)))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
; ((getenv "EMACS_EMBA_CI")
; '(created changed deleted))
;; There are two `deleted' events, for the file and for
;; the directory. Except for cygwin and kqueue. And
;; cygwin does not raise a `changed' event.
;; the directory. Except for cygwin, kqueue and remote
;; files. And cygwin does not raise a `changed' event.
((eq system-type 'cygwin)
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
((or (string-equal (file-notify--test-library) "kqueue")
(file-remote-p temporary-file-directory))
'(created changed deleted stopped))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed deleted))
(t '(created changed deleted deleted stopped)))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
......@@ -740,8 +741,11 @@ delivered."
'(created changed created changed deleted stopped))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed created changed deleted deleted))
; ((getenv "EMACS_EMBA_CI")
; '(created changed created changed deleted deleted))
;; Remote files return two `deleted' events.
((file-remote-p temporary-file-directory)
'(created changed created changed deleted deleted stopped))
(t '(created changed created changed
deleted deleted deleted stopped)))
(write-region
......@@ -786,18 +790,19 @@ delivered."
(file-notify--test-library) "gvfs-monitor-dir.exe")
'((deleted stopped)
(created deleted stopped)))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
; ((getenv "EMACS_EMBA_CI")
; '(created changed renamed deleted))
;; There are two `deleted' events, for the file and for
;; the directory. Except for cygwin and kqueue. And
;; cygwin raises `created' and `deleted' events instead
;; of a `renamed' event.
;; the directory. Except for cygwin, kqueue and remote
;; files. And cygwin raises `created' and `deleted'
;; events instead of a `renamed' event.
((eq system-type 'cygwin)
'(created created deleted deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
((or (string-equal (file-notify--test-library) "kqueue")
(file-remote-p temporary-file-directory))
'(created changed renamed deleted stopped))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed renamed deleted))
(t '(created changed renamed deleted deleted stopped)))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
......@@ -1041,11 +1046,12 @@ delivered."
'((deleted stopped)
(created deleted stopped)))
;; There are two `deleted' events, for the file and for
;; the directory. Except for cygwin and kqueue. And
;; cygwin does not raise a `changed' event.
;; the directory. Except for cygwin, kqueue and remote
;; files. And cygwin does not raise a `changed' event.
((eq system-type 'cygwin)
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
((or (string-equal (file-notify--test-library) "kqueue")
(file-remote-p temporary-file-directory))
'(created changed deleted stopped))
(t '(created changed deleted deleted stopped)))
(write-region
......@@ -1261,7 +1267,8 @@ delivered."
(file-notify--test-with-events
(cond
;; On cygwin we only get the `changed' event.
((eq system-type 'cygwin) '(changed))
((eq system-type 'cygwin)
'(changed))
(t '(renamed created changed)))
;; The file is renamed when creating a backup. It shall
;; still be watched.
......@@ -1402,11 +1409,15 @@ the file watch."
(cond
;; w32notify does not raise `deleted' and `stopped'
;; events for the watched directory.
((string-equal (file-notify--test-library) "w32notify") '())
((string-equal (file-notify--test-library) "w32notify")
'())
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'())
; ((getenv "EMACS_EMBA_CI")
; '())
;; Remote files send just one `stopped' event.
((file-remote-p temporary-file-directory)
'(stopped))
(t '(deleted stopped))))))
(delete-directory file-notify--test-tmpfile 'recursive))
(unless (getenv "EMACS_EMBA_CI")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment