summaryrefslogtreecommitdiff
path: root/test/automated
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-02-06 21:53:38 +0200
committerEli Zaretskii <eliz@gnu.org>2016-02-06 21:53:38 +0200
commit49e57490d0023b10629cd1a3c2d5f0fc6068a58c (patch)
tree850feff7bab4c92da3809addb91fb2b130c16761 /test/automated
parentbe1d87492e2fba479151edcaf7f3818675b1eac7 (diff)
downloademacs-49e57490d0023b10629cd1a3c2d5f0fc6068a58c.tar.gz
emacs-49e57490d0023b10629cd1a3c2d5f0fc6068a58c.tar.bz2
emacs-49e57490d0023b10629cd1a3c2d5f0fc6068a58c.zip
Fix file-notify-test on MS-Windows
* test/automated/file-notify-tests.el (file-notify--test-timeout): Reduce w32notify timeout to 10 sec. (file-notify-test06-many-events): Call read-event after each rename, to keep the w32notify backend happy in batch mode. (Bug#22534)
Diffstat (limited to 'test/automated')
-rw-r--r--test/automated/file-notify-tests.el12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index 629d85be1ef..5fc4ff8bf42 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -66,7 +66,7 @@
"Timeout to wait for arriving events, in seconds."
(cond
((file-remote-p temporary-file-directory) 6)
- ((string-equal (file-notify--test-library) "w32notify") 20)
+ ((string-equal (file-notify--test-library) "w32notify") 10)
((eq system-type 'cygwin) 10)
(t 3)))
@@ -797,10 +797,7 @@ longer than timeout seconds for the events to be delivered."
file-notify--test-tmpfile
'(change) 'file-notify--test-event-handler)))
(unwind-protect
- ;; In case of w32notify, the upper limit of events to handle
- ;; seems to be 260. Reason unknown.
- (let ((n (if (string-equal (file-notify--test-library) "w32notify")
- 250 1000))
+ (let ((n 1000)
source-file-list target-file-list
(default-directory file-notify--test-tmpfile))
(dotimes (i n)
@@ -832,10 +829,11 @@ longer than timeout seconds for the events to be delivered."
(let ((source-file-list source-file-list)
(target-file-list target-file-list))
(while (and source-file-list target-file-list)
- (rename-file (pop source-file-list) (pop target-file-list) t))))
+ (rename-file (pop source-file-list) (pop target-file-list) t)
+ (read-event nil nil 0.02))))
(file-notify--test-with-events (make-list n 'deleted)
(dolist (file target-file-list)
- (delete-file file))))
+ (prog1 (delete-file file) (read-event nil nil 0.02)))))
(file-notify--test-cleanup)))
(file-notify--deftest-remote file-notify-test06-many-events