]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/automated/file-notify-tests.el (file-notify--test-remote-enabled):
authorGlenn Morris <rgm@gnu.org>
Thu, 1 Aug 2013 23:10:51 +0000 (19:10 -0400)
committerGlenn Morris <rgm@gnu.org>
Thu, 1 Aug 2013 23:10:51 +0000 (19:10 -0400)
Try to check that the remote system has a notification program.

test/ChangeLog
test/automated/file-notify-tests.el

index f7d66fc1cef5a2a5f09405faaf60c11459640377..1efd86545aad91fbe670a8e0dfe92757dedddb44 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-01  Glenn Morris  <rgm@gnu.org>
+
+       * automated/file-notify-tests.el (file-notify--test-remote-enabled):
+       Try to check that the remote system has a notification program.
+
 2013-07-31  Glenn Morris  <rgm@gnu.org>
 
        * automated/undo-tests.el (undo-test2, undo-test5): Be quieter.
index 8bd4f258b1cafd124ea5fdb91198af831cbc1e46..9f552ee7ab1f0f6304fc7cffd0f1bebe3a590834 100644 (file)
@@ -43,6 +43,7 @@
 (defvar file-notify--test-event nil)
 
 (require 'tramp)
+(require 'tramp-sh)
 (setq tramp-verbose 0
       tramp-message-show-message nil)
 (when noninteractive (defalias 'tramp-read-passwd 'ignore))
   (ignore-errors
     (and (file-remote-p file-notify-test-remote-temporary-file-directory)
         (file-directory-p file-notify-test-remote-temporary-file-directory)
-        (file-writable-p file-notify-test-remote-temporary-file-directory))))
+        (file-writable-p file-notify-test-remote-temporary-file-directory)
+        ;; Extracted from tramp-sh-handle-file-notify-add-watch.
+        ;; Even though the "remote" system is just ssh@localhost,
+        ;; the PATH might not be the same as the "local" PATH.
+        ;; Eg this seems to be the case on hydra.nixos.org.
+        ;; Without this, tests fail with:
+        ;; "No file notification program found on /ssh:localhost:"
+        ;; Try to fix PATH instead?
+        (with-parsed-tramp-file-name
+            file-notify-test-remote-temporary-file-directory nil
+            (or (tramp-get-remote-gvfs-monitor-dir v)
+                (tramp-get-remote-inotifywait v))))))
 
 (defmacro file-notify--deftest-remote (test docstring)
   "Define ert `TEST-remote' for remote files."