1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

; Add command logging to some more Eshell tests

* test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline)
(esh-proc-test/kill-pipeline-head): Write debug logs on failure.
This commit is contained in:
Jim Porter 2024-06-15 11:06:58 -07:00
parent 1bc093e33c
commit 7df855cdfe

View File

@ -290,6 +290,7 @@ prompt. See bug#54136."
;; fine elsewhere.
(skip-when (getenv "EMACS_EMBA_CI"))
(with-temp-eshell
(ert-info (#'eshell-get-debug-logs :prefix "Command logs: ")
(eshell-insert-command
(concat "sh -c 'while true; do echo y; sleep 1; done' | "
"sh -c 'while true; do read NAME; done'"))
@ -297,10 +298,10 @@ prompt. See bug#54136."
(eshell-kill-process)
(eshell-wait-for-subprocess t)
(should (string-match-p
;; "interrupt\n" is for MS-Windows.
(rx (or "interrupt\n" "killed\n" "killed: 9\n" ""))
;; "interrupt" is for MS-Windows.
(rx bos (or "interrupt" "killed" "killed: 9" "") eol)
(buffer-substring-no-properties
output-start (eshell-end-of-output)))))))
output-start (eshell-end-of-output))))))))
(ert-deftest esh-proc-test/kill-pipeline-head ()
"Test that killing the first process in a pipeline doesn't
@ -309,6 +310,7 @@ write the exit status to the pipe. See bug#54136."
(executable-find "echo")
(executable-find "sleep")))
(with-temp-eshell
(ert-info (#'eshell-get-debug-logs :prefix "Command logs: ")
(eshell-insert-command
(concat "sh -c 'while true; do sleep 1; done' | "
"sh -c 'while read NAME; do echo =${NAME}=; done'"))
@ -317,7 +319,7 @@ write the exit status to the pipe. See bug#54136."
(eshell-wait-for-subprocess t)
(should (equal (buffer-substring-no-properties
output-start (eshell-end-of-output))
"")))))
""))))))
;; Remote processes