Commit 5f334658 authored by Michael Albinus's avatar Michael Albinus
Browse files

Report used native library in file-notify-tests.el

* test/automated/file-notify-tests.el
(tramp-get-remote-inotifywait): Declare them.
(file-notify-test00-availability): Print used native library.
parent 76093858
......@@ -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
......@@ -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.
"%s library: `%s'"
(if (null (file-remote-p temporary-file-directory)) "Local" "Remote")
(if (null (file-remote-p temporary-file-directory))
;; 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
;; 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"))))))
(setq file-notify--test-desc
(file-notify-add-watch temporary-file-directory '(change) 'ignore)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment