From: Glenn Morris Date: Thu, 1 Aug 2013 23:10:51 +0000 (-0400) Subject: * test/automated/file-notify-tests.el (file-notify--test-remote-enabled): X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1688^2~39 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d7e9a7314a07a690f19ad4baff93e99445db005;p=emacs.git * test/automated/file-notify-tests.el (file-notify--test-remote-enabled): Try to check that the remote system has a notification program. --- diff --git a/test/ChangeLog b/test/ChangeLog index f7d66fc1cef..1efd86545aa 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2013-08-01 Glenn Morris + + * 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 * automated/undo-tests.el (undo-test2, undo-test5): Be quieter. diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 8bd4f258b1c..9f552ee7ab1 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -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)) @@ -57,7 +58,18 @@ (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."