aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2014-02-04 12:41:20 +0100
committerMichael Albinus2014-02-04 12:41:20 +0100
commit40d2f2e4bb6b4e0b373180ae12836f6b335dc0bb (patch)
treea55dbab6c5612f7c60285d55b9510220137764a2 /test
parent86d2bf49962c66f19e467804dfcfb5153b460f51 (diff)
downloademacs-40d2f2e4bb6b4e0b373180ae12836f6b335dc0bb.tar.gz
emacs-40d2f2e4bb6b4e0b373180ae12836f6b335dc0bb.zip
* automated/file-notify-tests.el (file-notify--wait-for-events):
Use `read-event' instead of `sit-for'. (file-notify-test02-events): Remove expected result, the bug is fixed meanwhile. (file-notify-test02-events, file-notify-test03-autorevert): Use `sleep-for' instead of `sit-for'.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog9
-rw-r--r--test/automated/file-notify-tests.el19
2 files changed, 15 insertions, 13 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 5afc9890aff..597782da416 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,12 @@
12014-02-04 Michael Albinus <michael.albinus@gmx.de>
2
3 * automated/file-notify-tests.el (file-notify--wait-for-events):
4 Use `read-event' instead of `sit-for'.
5 (file-notify-test02-events): Remove expected result, the bug is
6 fixed meanwhile.
7 (file-notify-test02-events, file-notify-test03-autorevert):
8 Use `sleep-for' instead of `sit-for'.
9
12014-01-31 Dmitry Gutov <dgutov@yandex.ru> 102014-01-31 Dmitry Gutov <dgutov@yandex.ru>
2 11
3 * automated/ruby-mode-tests.el (ruby-align-chained-calls): 12 * automated/ruby-mode-tests.el (ruby-align-chained-calls):
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index e92595f0ec6..f1d9aee974c 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -187,17 +187,10 @@ Save the result in `file-notify--test-results', for later analysis."
187TIMEOUT is the maximum time to wait for, in seconds." 187TIMEOUT is the maximum time to wait for, in seconds."
188 `(with-timeout (,timeout (ignore)) 188 `(with-timeout (,timeout (ignore))
189 (while (null ,until) 189 (while (null ,until)
190 (let (noninteractive) 190 (read-event nil nil 0.1))))
191 (sit-for 0.1 'nodisplay)))))
192 191
193(ert-deftest file-notify-test02-events () 192(ert-deftest file-notify-test02-events ()
194 "Check file creation/removal notifications." 193 "Check file creation/removal notifications."
195 ;; Bug#16519.
196 :expected-result
197 (if (and noninteractive
198 (not (file-remote-p temporary-file-directory))
199 (memq file-notify--library '(gfilenotify w32notify)))
200 :failed :passed)
201 (skip-unless (file-notify--test-local-enabled)) 194 (skip-unless (file-notify--test-local-enabled))
202 (let (desc) 195 (let (desc)
203 (unwind-protect 196 (unwind-protect
@@ -214,7 +207,7 @@ TIMEOUT is the maximum time to wait for, in seconds."
214 (write-region 207 (write-region
215 "any text" nil file-notify--test-tmpfile nil 'no-message) 208 "any text" nil file-notify--test-tmpfile nil 'no-message)
216 (delete-file file-notify--test-tmpfile) 209 (delete-file file-notify--test-tmpfile)
217 (sit-for 0.1 'nodisplay) 210 (sleep-for 0.1)
218 211
219 ;; Check copy and rename. 212 ;; Check copy and rename.
220 (write-region 213 (write-region
@@ -222,13 +215,13 @@ TIMEOUT is the maximum time to wait for, in seconds."
222 (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1) 215 (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1)
223 (delete-file file-notify--test-tmpfile) 216 (delete-file file-notify--test-tmpfile)
224 (delete-file file-notify--test-tmpfile1) 217 (delete-file file-notify--test-tmpfile1)
225 (sit-for 0.1 'nodisplay) 218 (sleep-for 0.1)
226 219
227 (write-region 220 (write-region
228 "any text" nil file-notify--test-tmpfile nil 'no-message) 221 "any text" nil file-notify--test-tmpfile nil 'no-message)
229 (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1) 222 (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1)
230 (delete-file file-notify--test-tmpfile1) 223 (delete-file file-notify--test-tmpfile1)
231 (sit-for 0.1 'nodisplay)) 224 (sleep-for 0.1))
232 225
233 ;; Wait for events, and exit. 226 ;; Wait for events, and exit.
234 (file-notify--wait-for-events 5 file-notify--test-results) 227 (file-notify--wait-for-events 5 file-notify--test-results)
@@ -274,7 +267,7 @@ This test is skipped in batch mode."
274 ;; `auto-revert-buffers' runs every 5". 267 ;; `auto-revert-buffers' runs every 5".
275 (with-timeout (timeout (ignore)) 268 (with-timeout (timeout (ignore))
276 (while (null auto-revert-notify-watch-descriptor) 269 (while (null auto-revert-notify-watch-descriptor)
277 (sit-for 1 'nodisplay))) 270 (sleep-for 1)))
278 271
279 ;; Check, that file notification has been used. 272 ;; Check, that file notification has been used.
280 (should auto-revert-mode) 273 (should auto-revert-mode)
@@ -283,7 +276,7 @@ This test is skipped in batch mode."
283 276
284 ;; Modify file. We wait for a second, in order to 277 ;; Modify file. We wait for a second, in order to
285 ;; have another timestamp. 278 ;; have another timestamp.
286 (sit-for 1) 279 (sleep-for 1)
287 (shell-command 280 (shell-command
288 (format "echo -n 'another text' >%s" 281 (format "echo -n 'another text' >%s"
289 (or (file-remote-p file-notify--test-tmpfile 'localname) 282 (or (file-remote-p file-notify--test-tmpfile 'localname)