summaryrefslogtreecommitdiff
path: root/test/lisp/eshell/eshell-tests-helpers.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2023-03-10 19:02:26 -0800
committerJim Porter <jporterbugs@gmail.com>2024-05-29 12:09:05 -0700
commit6c2f21e4a6ff65cc1697cb8a6ba0e1ef1a52ae1c (patch)
tree45e81f3bd365ef76fcf7f08ae00e5bfab9173af3 /test/lisp/eshell/eshell-tests-helpers.el
parent98149ad31ea2cfd5a82f95443affd665c9da667b (diff)
downloademacs-6c2f21e4a6ff65cc1697cb8a6ba0e1ef1a52ae1c.tar.gz
emacs-6c2f21e4a6ff65cc1697cb8a6ba0e1ef1a52ae1c.tar.bz2
emacs-6c2f21e4a6ff65cc1697cb8a6ba0e1ef1a52ae1c.zip
Consolidate Eshell module loading/unloading code
This also adds the ability to suppress module loading/unloading messages, which will be necessary to support running Eshell scripts as batch scripts. * lisp/eshell/esh-mode.el (eshell-mode): Move module loading/initialization to... * lisp/eshell/esh-module.el (eshell-load-modules) (eshell-initialize-modules): ... here. (eshell-module-loading-messages): New option. (eshell-module--feature-name): Improve docstring. (eshell-unload-modules): Display a real warning if unable to unload a module. * test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell) (eshell-command-result-equal): * test/lisp/eshell/eshell-tests-unload.el (load-eshell): Silence Eshell loading messages.
Diffstat (limited to 'test/lisp/eshell/eshell-tests-helpers.el')
-rw-r--r--test/lisp/eshell/eshell-tests-helpers.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/lisp/eshell/eshell-tests-helpers.el b/test/lisp/eshell/eshell-tests-helpers.el
index 652146fefcc..3f1c55f420d 100644
--- a/test/lisp/eshell/eshell-tests-helpers.el
+++ b/test/lisp/eshell/eshell-tests-helpers.el
@@ -63,6 +63,7 @@ beginning of the test file."
(eshell-debug-command (cons 'process eshell-debug-command))
(eshell-history-file-name nil)
(eshell-last-dir-ring-file-name nil)
+ (eshell-module-loading-messages nil)
(eshell-buffer (eshell t)))
(unwind-protect
(with-current-buffer eshell-buffer
@@ -183,10 +184,11 @@ inserting the command."
(defun eshell-command-result-equal (command result)
"Execute COMMAND non-interactively and compare it to RESULT."
(ert-info (#'eshell-get-debug-logs :prefix "Command logs: ")
- (should (eshell-command-result--equal
- command
- (eshell-test-command-result command)
- result))))
+ (let ((eshell-module-loading-messages nil))
+ (should (eshell-command-result--equal
+ command
+ (eshell-test-command-result command)
+ result)))))
(provide 'eshell-tests-helpers)