]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt `accept-process-output' arguments in tramp-tests
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 29 Jan 2019 16:26:14 +0000 (17:26 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 29 Jan 2019 16:26:14 +0000 (17:26 +0100)
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp-test30-make-process, tramp-test31-interrupt-process)
(tramp-test32-shell-command)
(tramp--test-shell-command-to-string-asynchronously)
(tramp-test43-asynchronous-requests):
Adapt `accept-process-output' arguments.

test/lisp/net/tramp-archive-tests.el
test/lisp/net/tramp-tests.el

index 0d0062e196ac8980da6b1e7742baa848e3668680..1d9de39ae96c49b42ded97a86f918251127a158f 100644 (file)
@@ -515,7 +515,7 @@ This checks also `file-name-as-directory', `file-name-directory',
   (skip-unless tramp-archive-enabled)
 
   (let ((tmp-name tramp-archive-test-archive)
-       (files '("." ".." "bar"  "baz.tar" "foo.hrd" "foo.lnk" "foo.txt")))
+       (files '("." ".." "bar" "baz.tar" "foo.hrd" "foo.lnk" "foo.txt")))
     (unwind-protect
        (progn
          (should (file-directory-p tmp-name))
index 7fa25f1baf3b2436b64eff8c32fd388be8267d53..c52f0092f60221552b6c11011e8d21366842846a 100644 (file)
@@ -3818,7 +3818,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            ;; Read output.
            (with-timeout (10 (ert-fail "`start-file-process' timed out"))
              (while (< (- (point-max) (point-min)) (length "foo"))
-               (accept-process-output proc 0.1)))
+               (while (accept-process-output proc 0 nil t))))
            (should (string-equal (buffer-string) "foo")))
 
        ;; Cleanup.
@@ -3836,7 +3836,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            ;; Read output.
            (with-timeout (10 (ert-fail "`start-file-process' timed out"))
              (while (< (- (point-max) (point-min)) (length "foo"))
-               (accept-process-output proc 0.1)))
+               (while (accept-process-output proc 0 nil t))))
            (should (string-equal (buffer-string) "foo")))
 
        ;; Cleanup.
@@ -3857,7 +3857,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            ;; Read output.
            (with-timeout (10 (ert-fail "`start-file-process' timed out"))
              (while (< (- (point-max) (point-min)) (length "foo"))
-               (accept-process-output proc 0.1)))
+               (while (accept-process-output proc 0 nil t))))
            (should (string-equal (buffer-string) "foo")))
 
        ;; Cleanup.
@@ -3890,7 +3890,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            ;; Read output.
            (with-timeout (10 (ert-fail "`make-process' timed out"))
              (while (< (- (point-max) (point-min)) (length "foo"))
-               (accept-process-output proc 0.1)))
+               (while (accept-process-output proc 0 nil t))))
            (should (string-equal (buffer-string) "foo")))
 
        ;; Cleanup.
@@ -3910,7 +3910,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            ;; Read output.
            (with-timeout (10 (ert-fail "`make-process' timed out"))
              (while (< (- (point-max) (point-min)) (length "foo"))
-               (accept-process-output proc 0.1)))
+               (while (accept-process-output proc 0 nil t))))
            (should (string-equal (buffer-string) "foo")))
 
        ;; Cleanup.
@@ -3935,7 +3935,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            ;; Read output.
            (with-timeout (10 (ert-fail "`make-process' timed out"))
              (while (< (- (point-max) (point-min)) (length "foo"))
-               (accept-process-output proc 0.1)))
+               (while (accept-process-output proc 0 nil t))))
            (should (string-equal (buffer-string) "foo")))
 
        ;; Cleanup.
@@ -3958,8 +3958,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
            (delete-process proc)
            ;; Read output.
            (with-timeout (10 (ert-fail "`make-process' timed out"))
-             (while (process-live-p proc)
-               (accept-process-output proc 0.1)))
+             (while (accept-process-output proc 0 nil t)))
            (should (string-equal (buffer-string) "killed\n")))
 
        ;; Cleanup.
@@ -3980,7 +3979,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
              (with-current-buffer stderr
                (with-timeout (10 (ert-fail "`make-process' timed out"))
                  (while (= (point-min) (point-max))
-                   (accept-process-output proc 0.1)))
+                   (while (accept-process-output proc 0 nil t))))
                (should
                 (string-equal (buffer-string) "cat: /: Is a directory\n"))))
 
@@ -4007,7 +4006,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
          (should (numberp (process-get proc 'remote-pid)))
          (should (interrupt-process proc))
          ;; Let the process accept the interrupt.
-          (accept-process-output proc 1 nil 0)
+         (while (accept-process-output proc nil nil 0))
          (should-not (process-live-p proc))
          ;; An interrupted process cannot be interrupted, again.
          (should-error (interrupt-process proc) :type 'error))
@@ -4056,10 +4055,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
             (current-buffer))
            ;; Read output.
            (with-timeout (10 (ert-fail "`async-shell-command' timed out"))
-             (while (< (- (point-max) (point-min))
-                       (1+ (length (file-name-nondirectory tmp-name))))
-               (accept-process-output
-                (get-buffer-process (current-buffer)) 0.1)))
+             (while (accept-process-output
+                     (get-buffer-process (current-buffer)) nil nil t)))
            ;; `ls' could produce colorized output.
            (goto-char (point-min))
            (while
@@ -4087,10 +4084,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
             (format "%s\n" (file-name-nondirectory tmp-name)))
            ;; Read output.
            (with-timeout (10 (ert-fail "`async-shell-command' timed out"))
-             (while (< (- (point-max) (point-min))
-                       (1+ (length (file-name-nondirectory tmp-name))))
-               (accept-process-output
-                (get-buffer-process (current-buffer)) 0.1)))
+             (while (accept-process-output
+                     (get-buffer-process (current-buffer)) nil nil t)))
            ;; `ls' could produce colorized output.
            (goto-char (point-min))
            (while
@@ -4112,10 +4107,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
   "Like `shell-command-to-string', but for asynchronous processes."
   (with-temp-buffer
     (async-shell-command command (current-buffer))
-    (with-timeout (10)
-      (while (get-buffer-process (current-buffer))
-       (accept-process-output (get-buffer-process (current-buffer)) 0.1)))
-    (accept-process-output nil 0.1)
+    (with-timeout (10 (ert-fail "`async-shell-command-to-string' timed out"))
+      (while (accept-process-output
+             (get-buffer-process (current-buffer)) nil nil t)))
     (buffer-substring-no-properties (point-min) (point-max))))
 
 ;; This test is inspired by Bug#23952.
@@ -5359,7 +5353,7 @@ process sentinels.  They shall not disturb each other."
                     (should (file-attributes file)))
                   ;; Send string to process.
                   (process-send-string proc (format "%s\n" (buffer-name buf)))
-                  (accept-process-output proc 0.1 nil 0)
+                  (while (accept-process-output proc 0 nil 0))
                   ;; Give the watchdog a chance.
                   (read-event nil nil 0.01)
                   (tramp--test-message