aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2019-05-05 12:20:44 +0200
committerMichael Albinus2019-05-05 12:20:44 +0200
commitf82e0e5b76da7f0374100628a5e439a0189b0255 (patch)
treec862e1035ec7935064e4200b06f30d8323d6232f /test
parentab64228883126791cba85de0641592203d5ae820 (diff)
downloademacs-f82e0e5b76da7f0374100628a5e439a0189b0255.tar.gz
emacs-f82e0e5b76da7f0374100628a5e439a0189b0255.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/autorevert-tests.el2
-rw-r--r--test/lisp/filenotify-tests.el59
2 files changed, 35 insertions, 26 deletions
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index d98c11658fe..af9edac1bea 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -309,9 +309,7 @@ This expects `auto-revert--messages' to be bound by
309 ;; polling. 309 ;; polling.
310 (should (string-match "any text" (buffer-string))) 310 (should (string-match "any text" (buffer-string)))
311 ;; With w32notify, the 'stopped' events are not sent. 311 ;; With w32notify, the 'stopped' events are not sent.
312 ;; Same for remote file name handlers. Why?
313 (or (eq file-notify--library 'w32notify) 312 (or (eq file-notify--library 'w32notify)
314 (file-remote-p temporary-file-directory)
315 (should-not auto-revert-notify-watch-descriptor)) 313 (should-not auto-revert-notify-watch-descriptor))
316 314
317 ;; Once the file has been recreated, the buffer shall be 315 ;; Once the file has been recreated, the buffer shall be
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index af2d0b33e08..b0273741bcb 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -682,17 +682,18 @@ delivered."
682 (file-notify--test-library) "gvfs-monitor-dir.exe") 682 (file-notify--test-library) "gvfs-monitor-dir.exe")
683 '((deleted stopped) 683 '((deleted stopped)
684 (created deleted stopped))) 684 (created deleted stopped)))
685 ;; On emba, `deleted' and `stopped' events of the
686 ;; directory are not detected.
687; ((getenv "EMACS_EMBA_CI")
688; '(created changed deleted))
685 ;; There are two `deleted' events, for the file and for 689 ;; There are two `deleted' events, for the file and for
686 ;; the directory. Except for cygwin and kqueue. And 690 ;; the directory. Except for cygwin, kqueue and remote
687 ;; cygwin does not raise a `changed' event. 691 ;; files. And cygwin does not raise a `changed' event.
688 ((eq system-type 'cygwin) 692 ((eq system-type 'cygwin)
689 '(created deleted stopped)) 693 '(created deleted stopped))
690 ((string-equal (file-notify--test-library) "kqueue") 694 ((or (string-equal (file-notify--test-library) "kqueue")
695 (file-remote-p temporary-file-directory))
691 '(created changed deleted stopped)) 696 '(created changed deleted stopped))
692 ;; On emba, `deleted' and `stopped' events of the
693 ;; directory are not detected.
694 ((getenv "EMACS_EMBA_CI")
695 '(created changed deleted))
696 (t '(created changed deleted deleted stopped))) 697 (t '(created changed deleted deleted stopped)))
697 (write-region 698 (write-region
698 "any text" nil file-notify--test-tmpfile nil 'no-message) 699 "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -740,8 +741,11 @@ delivered."
740 '(created changed created changed deleted stopped)) 741 '(created changed created changed deleted stopped))
741 ;; On emba, `deleted' and `stopped' events of the 742 ;; On emba, `deleted' and `stopped' events of the
742 ;; directory are not detected. 743 ;; directory are not detected.
743 ((getenv "EMACS_EMBA_CI") 744; ((getenv "EMACS_EMBA_CI")
744 '(created changed created changed deleted deleted)) 745; '(created changed created changed deleted deleted))
746 ;; Remote files return two `deleted' events.
747 ((file-remote-p temporary-file-directory)
748 '(created changed created changed deleted deleted stopped))
745 (t '(created changed created changed 749 (t '(created changed created changed
746 deleted deleted deleted stopped))) 750 deleted deleted deleted stopped)))
747 (write-region 751 (write-region
@@ -786,18 +790,19 @@ delivered."
786 (file-notify--test-library) "gvfs-monitor-dir.exe") 790 (file-notify--test-library) "gvfs-monitor-dir.exe")
787 '((deleted stopped) 791 '((deleted stopped)
788 (created deleted stopped))) 792 (created deleted stopped)))
793 ;; On emba, `deleted' and `stopped' events of the
794 ;; directory are not detected.
795; ((getenv "EMACS_EMBA_CI")
796; '(created changed renamed deleted))
789 ;; There are two `deleted' events, for the file and for 797 ;; There are two `deleted' events, for the file and for
790 ;; the directory. Except for cygwin and kqueue. And 798 ;; the directory. Except for cygwin, kqueue and remote
791 ;; cygwin raises `created' and `deleted' events instead 799 ;; files. And cygwin raises `created' and `deleted'
792 ;; of a `renamed' event. 800 ;; events instead of a `renamed' event.
793 ((eq system-type 'cygwin) 801 ((eq system-type 'cygwin)
794 '(created created deleted deleted stopped)) 802 '(created created deleted deleted stopped))
795 ((string-equal (file-notify--test-library) "kqueue") 803 ((or (string-equal (file-notify--test-library) "kqueue")
804 (file-remote-p temporary-file-directory))
796 '(created changed renamed deleted stopped)) 805 '(created changed renamed deleted stopped))
797 ;; On emba, `deleted' and `stopped' events of the
798 ;; directory are not detected.
799 ((getenv "EMACS_EMBA_CI")
800 '(created changed renamed deleted))
801 (t '(created changed renamed deleted deleted stopped))) 806 (t '(created changed renamed deleted deleted stopped)))
802 (write-region 807 (write-region
803 "any text" nil file-notify--test-tmpfile nil 'no-message) 808 "any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -1041,11 +1046,12 @@ delivered."
1041 '((deleted stopped) 1046 '((deleted stopped)
1042 (created deleted stopped))) 1047 (created deleted stopped)))
1043 ;; There are two `deleted' events, for the file and for 1048 ;; There are two `deleted' events, for the file and for
1044 ;; the directory. Except for cygwin and kqueue. And 1049 ;; the directory. Except for cygwin, kqueue and remote
1045 ;; cygwin does not raise a `changed' event. 1050 ;; files. And cygwin does not raise a `changed' event.
1046 ((eq system-type 'cygwin) 1051 ((eq system-type 'cygwin)
1047 '(created deleted stopped)) 1052 '(created deleted stopped))
1048 ((string-equal (file-notify--test-library) "kqueue") 1053 ((or (string-equal (file-notify--test-library) "kqueue")
1054 (file-remote-p temporary-file-directory))
1049 '(created changed deleted stopped)) 1055 '(created changed deleted stopped))
1050 (t '(created changed deleted deleted stopped))) 1056 (t '(created changed deleted deleted stopped)))
1051 (write-region 1057 (write-region
@@ -1261,7 +1267,8 @@ delivered."
1261 (file-notify--test-with-events 1267 (file-notify--test-with-events
1262 (cond 1268 (cond
1263 ;; On cygwin we only get the `changed' event. 1269 ;; On cygwin we only get the `changed' event.
1264 ((eq system-type 'cygwin) '(changed)) 1270 ((eq system-type 'cygwin)
1271 '(changed))
1265 (t '(renamed created changed))) 1272 (t '(renamed created changed)))
1266 ;; The file is renamed when creating a backup. It shall 1273 ;; The file is renamed when creating a backup. It shall
1267 ;; still be watched. 1274 ;; still be watched.
@@ -1402,11 +1409,15 @@ the file watch."
1402 (cond 1409 (cond
1403 ;; w32notify does not raise `deleted' and `stopped' 1410 ;; w32notify does not raise `deleted' and `stopped'
1404 ;; events for the watched directory. 1411 ;; events for the watched directory.
1405 ((string-equal (file-notify--test-library) "w32notify") '()) 1412 ((string-equal (file-notify--test-library) "w32notify")
1413 '())
1406 ;; On emba, `deleted' and `stopped' events of the 1414 ;; On emba, `deleted' and `stopped' events of the
1407 ;; directory are not detected. 1415 ;; directory are not detected.
1408 ((getenv "EMACS_EMBA_CI") 1416; ((getenv "EMACS_EMBA_CI")
1409 '()) 1417; '())
1418 ;; Remote files send just one `stopped' event.
1419 ((file-remote-p temporary-file-directory)
1420 '(stopped))
1410 (t '(deleted stopped)))))) 1421 (t '(deleted stopped))))))
1411 (delete-directory file-notify--test-tmpfile 'recursive)) 1422 (delete-directory file-notify--test-tmpfile 'recursive))
1412 (unless (getenv "EMACS_EMBA_CI") 1423 (unless (getenv "EMACS_EMBA_CI")