]> git.eshelyaron.com Git - emacs.git/commitdiff
Further improve filenotify-tests.el
authorKen Brown <kbrown@cornell.edu>
Sat, 31 Dec 2016 21:16:12 +0000 (16:16 -0500)
committerKen Brown <kbrown@cornell.edu>
Sat, 31 Dec 2016 21:16:12 +0000 (16:16 -0500)
* test/lisp/filenotify-tests.el
(file-notify--test-read-event): Adapt to file monitors of type
GFamFileMonitor, which occur on Cygwin.
(file-notify--test-monitor): Update doc string.

test/lisp/filenotify-tests.el

index e2bcc6b0f7ebcdfa734002a9b3f7e91636b889a9..bd7f191dac65a65f8457ec9db605b4d8a27cfe64 100644 (file)
@@ -70,10 +70,13 @@ There are different timeouts for local and remote file notification libraries."
   (read-event
    nil nil
    (cond
-    ;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5. So we must
-    ;; wait at least this time.
+    ;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5.  So we must
+    ;; wait at least this time in the GPollFileMonitor case.  A
+    ;; similar timeout seems to be needed in the GFamFileMonitor case,
+    ;; at least on Cygwin.
     ((and (string-equal (file-notify--test-library) "gfilenotify")
-         (string-equal (file-notify--test-monitor) "GPollFileMonitor"))
+          (memq (file-notify--test-monitor)
+                '(GFamFileMonitor GPollFileMonitor)))
      7)
     ((file-remote-p temporary-file-directory) 0.1)
     (t 0.01))))
@@ -204,7 +207,7 @@ remote host, or nil."
          (process-name (cdr file-notify--test-remote-enabled-checked))))))
 
 (defun file-notify--test-monitor ()
-  "The used monitor for the test, as a string.
+  "The used monitor for the test, as a symbol.
 This returns only for the local case and gfilenotify; otherwise it is nil.
 `file-notify--test-desc' must be a valid watch descriptor."
   (and file-notify--test-desc