aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2017-01-27 10:28:15 +0200
committerEli Zaretskii2017-01-27 10:28:15 +0200
commite26166aae0616264a476cac3ba1e2c5979d442b5 (patch)
tree791a1d9b5d3f3183a80995e828820728c1bc7ec1
parent7cb7a582f44db94292709d35f4f5474f891f03b0 (diff)
downloademacs-e26166aae0616264a476cac3ba1e2c5979d442b5.tar.gz
emacs-e26166aae0616264a476cac3ba1e2c5979d442b5.zip
Fix filenotify-tests on MS-Windows
* test/lisp/filenotify-tests.el (file-notify-test04-file-validity) (file-notify-test05-dir-validity) (file-notify-test06-many-events) (file-notify-test08-watched-file-in-watched-dir): Manually remove the watch descriptor before calling file-notify--test-cleanup-p. (Bug#25539)
-rw-r--r--test/lisp/filenotify-tests.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index d237d0cc06e..db7f55e8fc5 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -850,6 +850,13 @@ delivered."
850 ;; After deleting the parent directory, the descriptor must 850 ;; After deleting the parent directory, the descriptor must
851 ;; not be valid anymore. 851 ;; not be valid anymore.
852 (should-not (file-notify-valid-p file-notify--test-desc)) 852 (should-not (file-notify-valid-p file-notify--test-desc))
853 ;; w32notify doesn't generate 'stopped' events when the parent
854 ;; directory is deleted, which doesn't provide a chance for
855 ;; filenotify.el to remove the descriptor from the internal
856 ;; hash table it maintains. So we must remove the descriptor
857 ;; manually.
858 (if (string-equal (file-notify--test-library) "w32notify")
859 (file-notify--rm-descriptor file-notify--test-desc))
853 860
854 ;; The environment shall be cleaned up. 861 ;; The environment shall be cleaned up.
855 (file-notify--test-cleanup-p)) 862 (file-notify--test-cleanup-p))
@@ -906,6 +913,8 @@ delivered."
906 (file-notify--test-timeout) 913 (file-notify--test-timeout)
907 (not (file-notify-valid-p file-notify--test-desc))) 914 (not (file-notify-valid-p file-notify--test-desc)))
908 (should-not (file-notify-valid-p file-notify--test-desc)) 915 (should-not (file-notify-valid-p file-notify--test-desc))
916 (if (string-equal (file-notify--test-library) "w32notify")
917 (file-notify--rm-descriptor file-notify--test-desc))
909 918
910 ;; The environment shall be cleaned up. 919 ;; The environment shall be cleaned up.
911 (file-notify--test-cleanup-p)) 920 (file-notify--test-cleanup-p))
@@ -975,6 +984,8 @@ delivered."
975 (file-notify--test-read-event) 984 (file-notify--test-read-event)
976 (delete-file file))) 985 (delete-file file)))
977 (delete-directory file-notify--test-tmpfile) 986 (delete-directory file-notify--test-tmpfile)
987 (if (string-equal (file-notify--test-library) "w32notify")
988 (file-notify--rm-descriptor file-notify--test-desc))
978 989
979 ;; The environment shall be cleaned up. 990 ;; The environment shall be cleaned up.
980 (file-notify--test-cleanup-p)) 991 (file-notify--test-cleanup-p))
@@ -1184,6 +1195,9 @@ the file watch."
1184 (delete-directory file-notify--test-tmpfile 'recursive)) 1195 (delete-directory file-notify--test-tmpfile 'recursive))
1185 (should-not (file-notify-valid-p file-notify--test-desc1)) 1196 (should-not (file-notify-valid-p file-notify--test-desc1))
1186 (should-not (file-notify-valid-p file-notify--test-desc2)) 1197 (should-not (file-notify-valid-p file-notify--test-desc2))
1198 (when (string-equal (file-notify--test-library) "w32notify")
1199 (file-notify--rm-descriptor file-notify--test-desc1)
1200 (file-notify--rm-descriptor file-notify--test-desc2))
1187 1201
1188 ;; The environment shall be cleaned up. 1202 ;; The environment shall be cleaned up.
1189 (file-notify--test-cleanup-p)) 1203 (file-notify--test-cleanup-p))