]> git.eshelyaron.com Git - emacs.git/commitdiff
Show test name in ERT progress bar
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 18 Jun 2025 18:12:55 +0000 (20:12 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 22 Jun 2025 07:49:53 +0000 (09:49 +0200)
* lisp/emacs-lisp/ert.el
(ert--results-progress-bar-button-help-echo): New defun.
(ert--results-progress-bar-button): Use it.

(cherry picked from commit 5310083ba07f1a0f97a96901846be08e98508e04)

lisp/emacs-lisp/ert.el

index cffb5a4866bad156674496f0c3e8aa45f620788a..3a9ba594eaf78cd6e0ccc49f5e5f3d5deca8895f 100644 (file)
@@ -2392,7 +2392,7 @@ SELECTOR; the default t means run all the defined tests."
 
 (define-button-type 'ert--results-progress-bar-button
   'action #'ert--results-progress-bar-button-action
-  'help-echo "mouse-2, RET: Reveal test result")
+  'help-echo #'ert--results-progress-bar-button-help-echo)
 
 (define-button-type 'ert--test-name-button
   'action #'ert--test-name-button-action
@@ -2621,6 +2621,14 @@ definition."
   (goto-char (ert--button-action-position))
   (ert-results-jump-between-summary-and-result))
 
+(defun ert--results-progress-bar-button-help-echo (_window _object pos)
+  "Show the test name in `help-echo'."
+  (format
+   "%s\nmouse-2, RET: Reveal test result"
+   (save-excursion
+     (goto-char pos)
+     (or (ert-test-at-point) ""))))
+
 (defun ert-results-rerun-all-tests ()
   "Re-run all tests, using the same selector.