summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2015-09-10 20:01:33 +0200
committerMichael Albinus <michael.albinus@gmx.de>2015-09-10 20:01:33 +0200
commit5f334658668eef0fd3c11d24167437fbd5cb3fc1 (patch)
tree939737f41fa8af5d80c045f6f66d664fa8b9487d /test
parent76093858d236b2134dd5db214d22a2b208c2992c (diff)
downloademacs-5f334658668eef0fd3c11d24167437fbd5cb3fc1.tar.gz
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.
Diffstat (limited to 'test')
-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 @@
(require 'filenotify)
(require 'tramp)
+(declare-function tramp-get-remote-gvfs-monitor-dir "tramp-sh")
+(declare-function tramp-get-remote-inotifywait "tramp-sh")
+
;; There is no default value on w32 systems, which could work out of the box.
(defconst file-notify-test-remote-temporary-file-directory
(cond
@@ -136,6 +139,23 @@ being the result.")
(ert-deftest file-notify-test00-availability ()
"Test availability of `file-notify'."
(skip-unless (file-notify--test-local-enabled))
+ ;; Report the native library which has been used.
+ (message
+ "%s library: `%s'"
+ (if (null (file-remote-p temporary-file-directory)) "Local" "Remote")
+ (if (null (file-remote-p temporary-file-directory))
+ file-notify--library
+ ;; FIXME: This is rude, using Tramp internal functions. Maybe
+ ;; the upcoming `file-notify-available-p' could return the used
+ ;; native library.
+ (with-parsed-tramp-file-name temporary-file-directory nil
+ (cond
+ ;; gvfs-monitor-dir.
+ ((tramp-get-remote-gvfs-monitor-dir v) 'gfilenotify)
+ ;; inotifywait.
+ ((tramp-get-remote-inotifywait v) 'inotify)
+ ;; None.
+ (t (ert-fail "No remote library available"))))))
(should
(setq file-notify--test-desc
(file-notify-add-watch temporary-file-directory '(change) 'ignore)))