emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master fc9dc03: Fix tests in file-notify-tests.el


From: Michael Albinus
Subject: [Emacs-diffs] master fc9dc03: Fix tests in file-notify-tests.el
Date: Sat, 12 Sep 2015 08:37:41 +0000

branch: master
commit fc9dc032906d840f63d29fbdcfd25e36ca3451b8
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix tests in file-notify-tests.el
    
    * test/automated/file-notify-tests.el: Remove Tramp declarations.
    (file-notify-test00-availability): Print remote command w/o Tramp
    internal functions.
    (file-notify-test02-events, file-notify-test02-events-remote):
    Adapt docstring.
    (file-notify-test03-autorevert): Use `format-message' when
    inspecting *Messages* buffer.
---
 test/automated/file-notify-tests.el |   37 ++++++++++++----------------------
 1 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/test/automated/file-notify-tests.el 
b/test/automated/file-notify-tests.el
index 99b0ebc..18e1b93 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -39,9 +39,6 @@
 (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
@@ -140,22 +137,12 @@ being the result.")
   "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"))))))
+  (if (null (file-remote-p temporary-file-directory))
+      (message "Local library: `%s'" file-notify--library)
+    (message "Remote command: `%s'"
+             (replace-regexp-in-string
+              "<[[:digit:]]+>\\'" ""
+              (process-name (cdr file-notify--test-remote-enabled-checked)))))
   (should
    (setq file-notify--test-desc
          (file-notify-add-watch temporary-file-directory '(change) 'ignore)))
@@ -261,7 +248,7 @@ Don't wait longer than TIMEOUT seconds for the events to be 
delivered."
        (setq file-notify--test-events ,outer))))
 
 (ert-deftest file-notify-test02-events ()
-  "Check file creation/removal notifications."
+  "Check file creation/change/removal notifications."
   (skip-unless (file-notify--test-local-enabled))
   (unwind-protect
       (progn
@@ -317,11 +304,12 @@ Don't wait longer than TIMEOUT seconds for the events to 
be delivered."
         (dolist (result file-notify--test-results)
           ;;(message "%s" (ert-test-result-messages result))
           (when (ert-test-failed-p result)
-            (ert-fail (cadr (ert-test-result-with-condition-condition 
result))))))
+            (ert-fail
+             (cadr (ert-test-result-with-condition-condition result))))))
     (file-notify--test-cleanup)))
 
 (file-notify--deftest-remote file-notify-test02-events
-  "Check file creation/removal notifications for remote files.")
+  "Check file creation/change/removal notifications for remote files.")
 
 (require 'autorevert)
 (setq auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded"
@@ -371,8 +359,9 @@ This test is skipped in batch mode."
            (with-current-buffer (get-buffer-create "*Messages*")
              (file-notify--wait-for-events
               timeout
-              (string-match (format "Reverting buffer `%s'." (buffer-name buf))
-                            (buffer-string))))
+              (string-match
+                (format-message "Reverting buffer `%s'." (buffer-name buf))
+                (buffer-string))))
            (should (string-match "another text" (buffer-string)))))
 
       ;; Exit.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]