From: Jim Porter Date: Fri, 1 Sep 2023 16:26:14 +0000 (-0700) Subject: ; Fix debug logging for synchronous commands in Eshell tests X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=da8b323f82417697f9b772689810099f426fe616;p=emacs.git ; Fix debug logging for synchronous commands in Eshell tests * lisp/eshell/eshell.el (eshell-command-result): Call 'eshell-debug-command-start'. * test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell): Update comment. (eshell-test-command-result): Set 'eshell-debug-command'. --- diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index cbd0de3c093..a3f80f453eb 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -357,6 +357,7 @@ corresponding to a successful execution." (with-temp-buffer (let ((eshell-non-interactive-p t)) (eshell-mode) + (eshell-debug-command-start command) (let ((result (eshell-do-eval (list 'eshell-commands (list 'eshell-command-to-value diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el index e300f3d657a..c983c8fd2bb 100644 --- a/test/lisp/eshell/eshell-tests-helpers.el +++ b/test/lisp/eshell/eshell-tests-helpers.el @@ -58,7 +58,8 @@ beginning of the test file." ;; to remove this eventually once we're confident that ;; all the process bugs have been worked out. (At that ;; point, we can just enable this selectively when - ;; needed.) + ;; needed.) See also `eshell-test-command-result' + ;; below. (eshell-debug-command (cons 'process eshell-debug-command)) (eshell-history-file-name nil) (eshell-last-dir-ring-file-name nil) @@ -159,7 +160,10 @@ inserting the command." (defun eshell-test-command-result (command) "Like `eshell-command-result', but not using HOME." (ert-with-temp-directory eshell-directory-name - (let ((eshell-history-file-name nil)) + (let ((eshell-history-file-name nil) + ;; Enable process debug instrumentation. See + ;; `with-temp-eshell' above. + (eshell-debug-command (cons 'process eshell-debug-command))) (eshell-command-result command)))) (defun eshell-command-result--equal (_command actual expected)