aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2014-01-27 20:10:02 +0100
committerMichael Albinus2014-01-27 20:10:02 +0100
commitdc9c8c62df5c2d2c4d42a8f658dae854df74662e (patch)
tree59941dd105ff540bb7083680d8e2eab71ca3b043 /test
parentd269bb996424d8c5b251f0a03731c09839a43d33 (diff)
downloademacs-dc9c8c62df5c2d2c4d42a8f658dae854df74662e.tar.gz
emacs-dc9c8c62df5c2d2c4d42a8f658dae854df74662e.zip
* automated/file-notify-tests.el (file-notify--deftest-remote):
Do not skip when the local test has failed. They are unrelated. (file-notify--wait-for-events): Use `sit-for'. Let-bind `noninteractive' to nil, otherwise `sit-for' could be degraded to `sleep-for'. (file-notify-test02-events): Check for `file-remote-p' instead of `file-notify--test-remote-enabled'.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog10
-rw-r--r--test/automated/file-notify-tests.el15
2 files changed, 14 insertions, 11 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index d09d9e524a3..50ffd7c3957 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,13 @@
12014-01-27 Michael Albinus <michael.albinus@gmx.de>
2
3 * automated/file-notify-tests.el (file-notify--deftest-remote):
4 Do not skip when the local test has failed. They are unrelated.
5 (file-notify--wait-for-events): Use `sit-for'. Let-bind
6 `noninteractive' to nil, otherwise `sit-for' could be degraded to
7 `sleep-for'.
8 (file-notify-test02-events): Check for `file-remote-p' instead of
9 `file-notify--test-remote-enabled'.
10
12014-01-26 Michael Albinus <michael.albinus@gmx.de> 112014-01-26 Michael Albinus <michael.albinus@gmx.de>
2 12
3 * automated/file-notify-tests.el (file-notify-test02-events): 13 * automated/file-notify-tests.el (file-notify-test02-events):
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index 242a813f034..e92595f0ec6 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -102,11 +102,6 @@ being the result.")
102 file-notify-test-remote-temporary-file-directory) 102 file-notify-test-remote-temporary-file-directory)
103 (ert-test (ert-get-test ',test))) 103 (ert-test (ert-get-test ',test)))
104 (skip-unless (file-notify--test-remote-enabled)) 104 (skip-unless (file-notify--test-remote-enabled))
105 ;; The local test could have passed, skipped, or quit. All of
106 ;; these results should not prevent us to run the remote test.
107 ;; That's why we skip only for failed local tests.
108 (skip-unless
109 (not (ert-test-failed-p (ert-test-most-recent-result ert-test))))
110 (tramp-cleanup-connection 105 (tramp-cleanup-connection
111 (tramp-dissect-file-name temporary-file-directory) nil 'keep-password) 106 (tramp-dissect-file-name temporary-file-directory) nil 'keep-password)
112 (funcall (ert-test-body ert-test))))) 107 (funcall (ert-test-body ert-test)))))
@@ -189,20 +184,18 @@ Save the result in `file-notify--test-results', for later analysis."
189 184
190(defmacro file-notify--wait-for-events (timeout until) 185(defmacro file-notify--wait-for-events (timeout until)
191 "Wait for file notification events until form UNTIL is true. 186 "Wait for file notification events until form UNTIL is true.
192TIMEOUT is the maximum time to wait for." 187TIMEOUT is the maximum time to wait for, in seconds."
193 `(with-timeout (,timeout (ignore)) 188 `(with-timeout (,timeout (ignore))
194 (while (null ,until) 189 (while (null ,until)
195 ;; glib events, and remote events. 190 (let (noninteractive)
196 (accept-process-output nil 0.1) 191 (sit-for 0.1 'nodisplay)))))
197 ;; inotify events.
198 (read-event nil nil 0.1))))
199 192
200(ert-deftest file-notify-test02-events () 193(ert-deftest file-notify-test02-events ()
201 "Check file creation/removal notifications." 194 "Check file creation/removal notifications."
202 ;; Bug#16519. 195 ;; Bug#16519.
203 :expected-result 196 :expected-result
204 (if (and noninteractive 197 (if (and noninteractive
205 (not (file-notify--test-remote-enabled)) 198 (not (file-remote-p temporary-file-directory))
206 (memq file-notify--library '(gfilenotify w32notify))) 199 (memq file-notify--library '(gfilenotify w32notify)))
207 :failed :passed) 200 :failed :passed)
208 (skip-unless (file-notify--test-local-enabled)) 201 (skip-unless (file-notify--test-local-enabled))