]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt tests for recent file-notification changes in Tramp
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 5 May 2019 10:20:44 +0000 (12:20 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 5 May 2019 10:20:44 +0000 (12:20 +0200)
* 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.

lisp/net/tramp.el
test/lisp/autorevert-tests.el
test/lisp/filenotify-tests.el

index c1fe413e368e0febec3c955d7477d3a26e54c989..911fa912727e58af41aa39f1f59a3e05e553b5b4 100644 (file)
@@ -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:
 
index d98c11658fed423990cfac6b6a1e8e5fd08fc9b7..af9edac1bea6679a1286dda8ff8dc8aedf79de2d 100644 (file)
@@ -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
index af2d0b33e08093c0c5522b762ec891f3068da976..b0273741bcba8613727d7f34e7a7c8f303a1a09d 100644 (file)
@@ -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")