aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2020-01-07 13:13:03 +0100
committerMichael Albinus2020-01-07 13:13:03 +0100
commitdd85664d23e29363fe08f8cbbf2b96472ac60fc1 (patch)
tree72bb05cb841e1a69d923dee0bb765e499346fe37 /test
parent4f2b41503b06f65f8c2789dfcd32d39e5172554d (diff)
downloademacs-dd85664d23e29363fe08f8cbbf2b96472ac60fc1.tar.gz
emacs-dd85664d23e29363fe08f8cbbf2b96472ac60fc1.zip
Implement stderr in tramp-adb-handle-make-process
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process): Implement `stderr'. * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Flush connection properties in time. * test/lisp/net/tramp-tests.el (tramp-test30-make-process) (tramp-test32-shell-command): Test asynchronous stderr for tramp-adb.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el124
1 files changed, 59 insertions, 65 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 2e4188ab76c..e2d7e35b52f 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4352,56 +4352,54 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4352 ;; Cleanup. 4352 ;; Cleanup.
4353 (ignore-errors (delete-process proc))) 4353 (ignore-errors (delete-process proc)))
4354 4354
4355 ;; Process with stderr buffer. tramp-adb.el doesn't support it (yet). 4355 ;; Process with stderr buffer.
4356 (unless (tramp--test-adb-p) 4356 (let ((stderr (generate-new-buffer "*stderr*")))
4357 (let ((stderr (generate-new-buffer "*stderr*"))) 4357 (unwind-protect
4358 (unwind-protect 4358 (with-temp-buffer
4359 (with-temp-buffer 4359 (setq proc
4360 (setq proc 4360 (with-no-warnings
4361 (with-no-warnings 4361 (make-process
4362 (make-process 4362 :name "test5" :buffer (current-buffer)
4363 :name "test5" :buffer (current-buffer) 4363 :command '("cat" "/")
4364 :command '("cat" "/") 4364 :stderr stderr
4365 :stderr stderr 4365 :file-handler t)))
4366 :file-handler t))) 4366 (should (processp proc))
4367 (should (processp proc)) 4367 ;; Read stderr.
4368 ;; Read stderr. 4368 (with-timeout (10 (tramp--test-timeout-handler))
4369 (with-timeout (10 (tramp--test-timeout-handler)) 4369 (while (accept-process-output proc 0 nil t)))
4370 (while (accept-process-output proc 0 nil t))) 4370 (delete-process proc)
4371 (delete-process proc) 4371 (with-current-buffer stderr
4372 (with-current-buffer stderr 4372 (should
4373 (should 4373 (string-match "cat:.* Is a directory" (buffer-string)))))
4374 (string-match "cat:.* Is a directory" (buffer-string)))))
4375 4374
4376 ;; Cleanup. 4375 ;; Cleanup.
4377 (ignore-errors (delete-process proc))) 4376 (ignore-errors (delete-process proc))
4378 (ignore-errors (kill-buffer stderr)))) 4377 (ignore-errors (kill-buffer stderr))))
4379 4378
4380 ;; Process with stderr file. tramp-adb.el doesn't support it (yet). 4379 ;; Process with stderr file.
4381 (unless (tramp--test-adb-p) 4380 (dolist (tmpfile `(,tmp-name1 ,tmp-name2))
4382 (dolist (tmpfile `(,tmp-name1 ,tmp-name2)) 4381 (unwind-protect
4383 (unwind-protect 4382 (with-temp-buffer
4383 (setq proc
4384 (with-no-warnings
4385 (make-process
4386 :name "test6" :buffer (current-buffer)
4387 :command '("cat" "/")
4388 :stderr tmpfile
4389 :file-handler t)))
4390 (should (processp proc))
4391 ;; Read stderr.
4392 (with-timeout (10 (tramp--test-timeout-handler))
4393 (while (accept-process-output proc nil nil t)))
4394 (delete-process proc)
4384 (with-temp-buffer 4395 (with-temp-buffer
4385 (setq proc 4396 (insert-file-contents tmpfile)
4386 (with-no-warnings 4397 (should
4387 (make-process 4398 (string-match "cat:.* Is a directory" (buffer-string)))))
4388 :name "test6" :buffer (current-buffer)
4389 :command '("cat" "/")
4390 :stderr tmpfile
4391 :file-handler t)))
4392 (should (processp proc))
4393 ;; Read stderr.
4394 (with-timeout (10 (tramp--test-timeout-handler))
4395 (while (accept-process-output proc nil nil t)))
4396 (delete-process proc)
4397 (with-temp-buffer
4398 (insert-file-contents tmpfile)
4399 (should
4400 (string-match "cat:.* Is a directory" (buffer-string)))))
4401 4399
4402 ;; Cleanup. 4400 ;; Cleanup.
4403 (ignore-errors (delete-process proc)) 4401 (ignore-errors (delete-process proc))
4404 (ignore-errors (delete-file tmpfile)))))))) 4402 (ignore-errors (delete-file tmpfile)))))))
4405 4403
4406(ert-deftest tramp-test31-interrupt-process () 4404(ert-deftest tramp-test31-interrupt-process ()
4407 "Check `interrupt-process'." 4405 "Check `interrupt-process'."
@@ -4521,25 +4519,23 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4521 ;; Cleanup. 4519 ;; Cleanup.
4522 (ignore-errors (delete-file tmp-name))) 4520 (ignore-errors (delete-file tmp-name)))
4523 4521
4524 ;; Test `async-shell-command' with error buffer. tramp-adb.el 4522 ;; Test `async-shell-command' with error buffer.
4525 ;; doesn't support it (yet). 4523 (let ((stderr (generate-new-buffer "*stderr*")) proc)
4526 (unless (tramp--test-adb-p) 4524 (unwind-protect
4527 (let ((stderr (generate-new-buffer "*stderr*")) proc) 4525 (with-temp-buffer
4528 (unwind-protect 4526 (async-shell-command "cat /; sleep 1" (current-buffer) stderr)
4529 (with-temp-buffer 4527 (setq proc (get-buffer-process (current-buffer)))
4530 (async-shell-command "cat /; sleep 1" (current-buffer) stderr) 4528 ;; Read stderr.
4531 (setq proc (get-buffer-process (current-buffer))) 4529 (when (processp proc)
4532 ;; Read stderr. 4530 (with-timeout (10 (tramp--test-timeout-handler))
4533 (when (processp proc) 4531 (while (accept-process-output proc nil nil t)))
4534 (with-timeout (10 (tramp--test-timeout-handler)) 4532 (delete-process proc))
4535 (while (accept-process-output proc nil nil t))) 4533 (with-current-buffer stderr
4536 (delete-process proc)) 4534 (should
4537 (with-current-buffer stderr 4535 (string-match "cat:.* Is a directory" (buffer-string)))))
4538 (should
4539 (string-match "cat:.* Is a directory" (buffer-string)))))
4540 4536
4541 ;; Cleanup. 4537 ;; Cleanup.
4542 (ignore-errors (kill-buffer stderr))))) 4538 (ignore-errors (kill-buffer stderr))))
4543 4539
4544 ;; Test sending string to `async-shell-command'. 4540 ;; Test sending string to `async-shell-command'.
4545 (unwind-protect 4541 (unwind-protect
@@ -6243,8 +6239,6 @@ If INTERACTIVE is non-nil, the tests are run interactively."
6243;; do not work properly for `nextcloud'. 6239;; do not work properly for `nextcloud'.
6244;; * Fix `tramp-test29-start-file-process' and 6240;; * Fix `tramp-test29-start-file-process' and
6245;; `tramp-test30-make-process' on MS Windows (`process-send-eof'?). 6241;; `tramp-test30-make-process' on MS Windows (`process-send-eof'?).
6246;; * Implement stderr for `adb' in `tramp-test30-make-process' and
6247;; `tramp-test32-shell-command'.
6248;; * Implement `tramp-test31-interrupt-process' for `adb'. 6242;; * Implement `tramp-test31-interrupt-process' for `adb'.
6249;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. A remote 6243;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. A remote
6250;; file name operation cannot run in the timer. Remove `:unstable' tag? 6244;; file name operation cannot run in the timer. Remove `:unstable' tag?