From c7370f7334957e36c49ec6bb65b09656025d554a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 25 Sep 2021 16:55:04 +0200 Subject: [PATCH] Extend and improve ERT manual section on running interactively * doc/misc/ert.texi (Running Tests Interactively): Format commands in a table, improve indexing, and add several missing commands. (Bug#41829) --- doc/misc/ert.texi | 92 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 16 deletions(-) diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index fafdb8c4eb4..b1695ac1729 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -260,36 +260,96 @@ unexpected result. In the example above, there are two failures, both due to failed @code{should} forms. @xref{Understanding Explanations}, for more details. +The following key bindings are available in the ERT results buffer: + +@table @kbd + +@item RET +@kindex RET@r{, in ert results buffer} +Each name of a function or macro in this buffer is a button; moving +point to it and typing @kbd{@key{RET}} jumps to its definition. + +@item TAB +@itemx S-TAB @kindex TAB@r{, in ert results buffer} @kindex S-TAB@r{, in ert results buffer} -In the ERT results buffer, @kbd{@key{TAB}} and @kbd{S-@key{TAB}} cycle between -buttons. Each name of a function or macro in this buffer is a button; -moving point to it and typing @kbd{@key{RET}} jumps to its definition. +Cycle between buttons forward and backward. +@item r @kindex r@r{, in ert results buffer} +@findex ert-results-rerun-test-at-point +Re-run the test near point on its own. + +@item d @kindex d@r{, in ert results buffer} +@findex ert-results-rerun-test-at-point-debugging-errors +Re-run the test near point on its own with the debugger enabled. + +@item R +@kindex R@r{, in ert results buffer} +@findex ert-results-rerun-all-tests +Re-run all tests. + +@item . @kindex .@r{, in ert results buffer} +@findex ert-results-find-test-at-point-other-window +Jump to the definition of the test near point. This has the same +effect as @kbd{@key{RET}}, but does not require point to be on the +name of the test. + +@item b @kindex b@r{, in ert results buffer} +@findex ert-results-pop-to-backtrace-for-test-at-point @cindex backtrace of a failed test -Pressing @kbd{r} re-runs the test near point on its own. Pressing -@kbd{d} re-runs it with the debugger enabled. @kbd{.} jumps to the -definition of the test near point (@kbd{@key{RET}} has the same effect -if point is on the name of the test). On a failed test, @kbd{b} shows -the backtrace of the failure. @xref{Debugging,, Backtraces, elisp, -GNU Emacs Lisp Reference Manual}, for more information about +Show the backtrace of a failed test. @xref{Debugging,, Backtraces, +elisp, GNU Emacs Lisp Reference Manual}, for more information about backtraces. +@item l @kindex l@r{, in ert results buffer} -@kbd{l} shows the list of @code{should} forms executed in the test. -If any messages were generated (with the Lisp function @code{message}) -in a test or any of the code that it invoked, @kbd{m} will show them. +@findex ert-results-pop-to-should-forms-for-test-at-point +Show the list of @code{should} forms executed in the test. +@item m +@kindex m@r{, in ert results buffer} +@findex ert-results-pop-to-messages-for-test-at-point +Show any messages that were generated (with the Lisp function +@code{message}) in in a test or any of the code that it invoked. + +@item L @kindex L@r{, in ert results buffer} +@findex ert-results-toggle-printer-limits-for-test-at-point By default, long expressions in the failure details are abbreviated -using @code{print-length} and @code{print-level}. Pressing @kbd{L} -while point is on a test failure will increase the limits to show more -of the expression. - +using @code{print-length} and @code{print-level}. Increase the limits +to show more of the expression by moving point to a test failure with +this command. + +@item D +@kindex D@r{, in ert results buffer} +@findex ert-delete-test +@cindex delete test +Delete a test from the running Emacs session. + +@item h +@kindex h@r{, in ert results buffer} +@findex ert-describe-test +Show the documentation of a test. + +@item T +@kindex T@r{, in ert results buffer} +@findex ert-results-pop-to-timings +Display test timings for the last run. + +@item M-x ert-delete-all-tests +@findex ert-delete-all-test +@cindex delete all tests +Delete all tests from the running session. + +@item M-x ert-describe-test +@findex ert-results-describe-test-at-point +Prompt for a test and then show its documentation. + +@end table @node Running Tests in Batch Mode @section Running Tests in Batch Mode -- 2.39.2