aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2015-09-10 20:01:33 +0200
committerMichael Albinus2015-09-10 20:01:33 +0200
commit5f334658668eef0fd3c11d24167437fbd5cb3fc1 (patch)
tree939737f41fa8af5d80c045f6f66d664fa8b9487d
parent76093858d236b2134dd5db214d22a2b208c2992c (diff)
downloademacs-5f334658668eef0fd3c11d24167437fbd5cb3fc1.tar.gz
emacs-5f334658668eef0fd3c11d24167437fbd5cb3fc1.zip
Report used native library in file-notify-tests.el
* test/automated/file-notify-tests.el (tramp-get-remote-gvfs-monitor-dir) (tramp-get-remote-inotifywait): Declare them. (file-notify-test00-availability): Print used native library.
-rw-r--r--test/automated/file-notify-tests.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index eee8ee35b6a..9831afd1d20 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -39,6 +39,9 @@
39(require 'filenotify) 39(require 'filenotify)
40(require 'tramp) 40(require 'tramp)
41 41
42(declare-function tramp-get-remote-gvfs-monitor-dir "tramp-sh")
43(declare-function tramp-get-remote-inotifywait "tramp-sh")
44
42;; There is no default value on w32 systems, which could work out of the box. 45;; There is no default value on w32 systems, which could work out of the box.
43(defconst file-notify-test-remote-temporary-file-directory 46(defconst file-notify-test-remote-temporary-file-directory
44 (cond 47 (cond
@@ -136,6 +139,23 @@ being the result.")
136(ert-deftest file-notify-test00-availability () 139(ert-deftest file-notify-test00-availability ()
137 "Test availability of `file-notify'." 140 "Test availability of `file-notify'."
138 (skip-unless (file-notify--test-local-enabled)) 141 (skip-unless (file-notify--test-local-enabled))
142 ;; Report the native library which has been used.
143 (message
144 "%s library: `%s'"
145 (if (null (file-remote-p temporary-file-directory)) "Local" "Remote")
146 (if (null (file-remote-p temporary-file-directory))
147 file-notify--library
148 ;; FIXME: This is rude, using Tramp internal functions. Maybe
149 ;; the upcoming `file-notify-available-p' could return the used
150 ;; native library.
151 (with-parsed-tramp-file-name temporary-file-directory nil
152 (cond
153 ;; gvfs-monitor-dir.
154 ((tramp-get-remote-gvfs-monitor-dir v) 'gfilenotify)
155 ;; inotifywait.
156 ((tramp-get-remote-inotifywait v) 'inotify)
157 ;; None.
158 (t (ert-fail "No remote library available"))))))
139 (should 159 (should
140 (setq file-notify--test-desc 160 (setq file-notify--test-desc
141 (file-notify-add-watch temporary-file-directory '(change) 'ignore))) 161 (file-notify-add-watch temporary-file-directory '(change) 'ignore)))