]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix debug logging for synchronous commands in Eshell tests
authorJim Porter <jporterbugs@gmail.com>
Fri, 1 Sep 2023 16:26:14 +0000 (09:26 -0700)
committerJim Porter <jporterbugs@gmail.com>
Fri, 1 Sep 2023 16:26:14 +0000 (09:26 -0700)
* 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'.

lisp/eshell/eshell.el
test/lisp/eshell/eshell-tests-helpers.el

index cbd0de3c093d5c5928ed444fa290ff0f4c5bbea1..a3f80f453ebb086ef4fb59f5c6a818e14dd9dfba 100644 (file)
@@ -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
index e300f3d657ac51c2857da53fbefa7f6c61d08429..c983c8fd2bb4dbb8f5ed68a9bb1052882822b722 100644 (file)
@@ -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)