emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115257: * automated/file-notify-tests.el


From: Michael Albinus
Subject: [Emacs-diffs] trunk r115257: * automated/file-notify-tests.el
Date: Wed, 27 Nov 2013 14:23:46 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115257
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Wed 2013-11-27 15:23:32 +0100
message:
  * automated/file-notify-tests.el
  (file-notify-test-remote-temporary-file-directory):
  Check $REMOTE_TEMPORARY_FILE_DIRECTORY.
  (tramp-read-passwd): Check $REMOTE_ALLOW_PASSWORD.
  (file-notify--deftest-remote): Cleanup connection initially.
  (file-notify-test03-autorevert): Run also in batch mode.  Use a
  larger timeout for remote files.  `sit-for' 1 second; 0.1 second
  does not work on MS Windows.  Call `accept-process-output' for
  remote files.  Apply `string-match' instead of `string-equal', the
  messages are different on MS Windows.
  
  * automated/tramp-tests.el (tramp-test-temporary-file-directory):
  Use $REMOTE_TEMPORARY_FILE_DIRECTORY.
  (tramp-read-passwd): Check $REMOTE_ALLOW_PASSWORD.
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/file-notify-tests.el 
filenotifytests.el-20130702144123-sxglvo6zs3jcj8w1-1
  test/automated/tramp-tests.el  tramptests.el-20131105142319-d9zp3oprkpxj5v1e-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2013-11-26 10:38:19 +0000
+++ b/test/ChangeLog    2013-11-27 14:23:32 +0000
@@ -1,3 +1,20 @@
+2013-11-27  Michael Albinus  <address@hidden>
+
+       * automated/file-notify-tests.el
+       (file-notify-test-remote-temporary-file-directory):
+       Check $REMOTE_TEMPORARY_FILE_DIRECTORY.
+       (tramp-read-passwd): Check $REMOTE_ALLOW_PASSWORD.
+       (file-notify--deftest-remote): Cleanup connection initially.
+       (file-notify-test03-autorevert): Run also in batch mode.  Use a
+       larger timeout for remote files.  `sit-for' 1 second; 0.1 second
+       does not work on MS Windows.  Call `accept-process-output' for
+       remote files.  Apply `string-match' instead of `string-equal', the
+       messages are different on MS Windows.
+
+       * automated/tramp-tests.el (tramp-test-temporary-file-directory):
+       Use $REMOTE_TEMPORARY_FILE_DIRECTORY.
+       (tramp-read-passwd): Check $REMOTE_ALLOW_PASSWORD.
+
 2013-11-23  Glenn Morris  <address@hidden>
 
        * automated/python-tests.el (python-shell-make-comint-1)

=== modified file 'test/automated/file-notify-tests.el'
--- a/test/automated/file-notify-tests.el       2013-11-13 15:36:12 +0000
+++ b/test/automated/file-notify-tests.el       2013-11-27 14:23:32 +0000
@@ -19,13 +19,17 @@
 
 ;;; Commentary:
 
-;; Some of the tests are intended to run over remote files.  Set
-;; `file-notify-test-remote-temporary-file-directory' to a suitable
-;; value.  It must NOT require an interactive password prompt, when
-;; running the tests in batch mode.
-
-;; If you want to skip tests for remote files, set this variable to
-;; `null-device'.
+;; Some of the tests require access to a remote host files.  Set
+;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
+;; to overwrite the default value.  If you want to skip tests
+;; accessing a remote host, set this environment variable to
+;; "/dev/null" or whatever is appropriate on your system.
+
+;; When running the tests in batch mode, it must NOT require an
+;; interactive password prompt unless the environment variable
+;; $REMOTE_ALLOW_PASSWORD is set.
+
+;; A whole test run can be performed calling the command 
`file-notify-test-all'.
 
 ;;; Code:
 
@@ -34,7 +38,10 @@
 
 ;; There is no default value on w32 systems, which could work out of the box.
 (defconst file-notify-test-remote-temporary-file-directory
-  (if (eq system-type 'windows-nt) null-device "/ssh::/tmp")
+  (cond
+   ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
+   ((eq system-type 'windows-nt) null-device)
+   (t (format "/ssh::%s" temporary-file-directory)))
   "Temporary directory for Tramp tests.")
 
 (defvar file-notify--test-tmpfile nil)
@@ -45,7 +52,11 @@
 (require 'tramp)
 (setq tramp-verbose 0
       tramp-message-show-message nil)
-(when noninteractive (defalias 'tramp-read-passwd 'ignore))
+
+;; Disable interactive passwords in batch mode.
+(when (and noninteractive (not (getenv "REMOTE_ALLOW_PASSWORD")))
+  (defalias 'tramp-read-passwd 'ignore))
+
 ;; This shall happen on hydra only.
 (when (getenv "NIX_STORE")
   (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
@@ -96,6 +107,8 @@
        ;; That's why we skip only for failed local tests.
        (skip-unless
        (not (ert-test-failed-p (ert-test-most-recent-result ert-test))))
+       (tramp-cleanup-connection
+       (tramp-dissect-file-name temporary-file-directory) nil 'keep-password)
        (funcall (ert-test-body ert-test)))))
 
 (ert-deftest file-notify-test00-availability ()
@@ -228,11 +241,11 @@
   "Check autorevert via file notification.
 This test is skipped in batch mode."
   (skip-unless (file-notify--test-local-enabled))
-  (skip-unless (not noninteractive))
   ;; `auto-revert-buffers' runs every 5".  And we must wait, until the
   ;; file has been reverted.
-  (let ((timeout 10)
-       buf)
+  (let* ((remote (file-remote-p temporary-file-directory))
+        (timeout (if remote 60 10))
+        buf)
     (unwind-protect
        (progn
          (setq file-notify--test-tmpfile (file-notify--test-make-temp-name))
@@ -247,7 +260,7 @@
            ;; `auto-revert-buffers' runs every 5".
            (with-timeout (timeout (ignore))
              (while (null auto-revert-notify-watch-descriptor)
-               (sit-for 0.1 'nodisplay)))
+               (sit-for 1 'nodisplay)))
 
            ;; Check, that file notification has been used.
            (should auto-revert-mode)
@@ -269,8 +282,10 @@
                    (null (string-match
                           (format "Reverting buffer `%s'." (buffer-name buf))
                           (buffer-string)))
-                 (sit-for 0.1 'nodisplay))))
-           (should (string-equal (buffer-string) "another text"))))
+                 ;; We must trigger the process filter to run.
+                 (when remote (accept-process-output nil 1))
+                 (sit-for 1 'nodisplay))))
+           (should (string-match "another text" (buffer-string)))))
 
       ;; Exit.
       (ignore-errors (kill-buffer buf))

=== modified file 'test/automated/tramp-tests.el'
--- a/test/automated/tramp-tests.el     2013-11-16 11:46:37 +0000
+++ b/test/automated/tramp-tests.el     2013-11-27 14:23:32 +0000
@@ -22,14 +22,14 @@
 ;; The tests require a recent ert.el from Emacs 24.4.
 
 ;; Some of the tests require access to a remote host files.  Set
-;; $TRAMP_TEST_TEMPORARY_FILE_DIRECTORY to a suitable value in order
+;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
 ;; to overwrite the default value.  If you want to skip tests
 ;; accessing a remote host, set this environment variable to
 ;; "/dev/null" or whatever is appropriate on your system.
 
 ;; When running the tests in batch mode, it must NOT require an
 ;; interactive password prompt unless the environment variable
-;; $TRAMP_TEST_ALLOW_PASSWORD is set.
+;; $REMOTE_ALLOW_PASSWORD is set.
 
 ;; A whole test run can be performed calling the command `tramp-test-all'.
 
@@ -41,7 +41,7 @@
 ;; There is no default value on w32 systems, which could work out of the box.
 (defconst tramp-test-temporary-file-directory
   (cond
-   ((getenv "TRAMP_TEST_TEMPORARY_FILE_DIRECTORY"))
+   ((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
    ((eq system-type 'windows-nt) null-device)
    (t (format "/ssh::%s" temporary-file-directory)))
   "Temporary directory for Tramp tests.")
@@ -50,7 +50,7 @@
       tramp-message-show-message nil)
 
 ;; Disable interactive passwords in batch mode.
-(when (and noninteractive (not (getenv "TRAMP_TEST_ALLOW_PASSWORD")))
+(when (and noninteractive (not (getenv "REMOTE_ALLOW_PASSWORD")))
   (defalias 'tramp-read-passwd 'ignore))
 
 ;; This shall happen on hydra only.
@@ -1193,6 +1193,12 @@
 ;; * set-file-selinux-context
 ;; * vc-registered
 
+;; * Fix `tramp-test17-insert-directory' for
+;;   `ls-lisp-insert-directory' ("plink" and friends).
+;; * Fix `tramp-test27-start-file-process' on MS Windows
+;;   (`process-send-eof'?).
+;; * Fix `tramp-test29-utf8' on MS Windows.
+
 (defun tramp-test-all (&optional interactive)
   "Run all tests for \\[tramp]."
   (interactive "p")


reply via email to

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