diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-01-24 14:00:50 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-01-24 14:01:06 +0100 |
commit | ead95479032f342eb7a493499f9edc7f2f2ec759 (patch) | |
tree | 655e7895db0c13692cfaedc3e4daf3e5902d4cc1 /lisp/emacs-lisp/find-func.el | |
parent | d0b9e269ee797cacf079ece5eaa54e846255cdc8 (diff) | |
download | emacs-ead95479032f342eb7a493499f9edc7f2f2ec759.tar.gz |
Allow jumping to ert failure definitions
* lisp/emacs-lisp/ert.el (ert-test):
(ert-deftest): Store the file name.
(ert-test-location): New function.
(ert-run-tests-batch): Use it.
* lisp/emacs-lisp/find-func.el (find-ert-deftest-regexp): New
variable.
(find-function-regexp-alist): Add ert-deftest (bug#22471).
Based on code by Phillip Lord <phillip.lord@russet.org.uk>.
Diffstat (limited to 'lisp/emacs-lisp/find-func.el')
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index c4f48b8a79e..6eac25c1004 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -123,6 +123,15 @@ should insert the feature name." :group 'xref :version "25.1") +(defcustom find-ert-deftest-regexp + "(ert-deftest +'%s" + "The regexp used to search for an ert-deftest definition. +Note it must contain a `%s' at the place where `format' +should insert the feature name." + :type 'regexp + :group 'xref + :version "29.1") + (defun find-function--defface (symbol) (catch 'found (while (re-search-forward (format find-face-regexp symbol) nil t) @@ -136,7 +145,8 @@ should insert the feature name." (defvar . find-variable-regexp) (defface . find-function--defface) (feature . find-feature-regexp) - (defalias . find-alias-regexp)) + (defalias . find-alias-regexp) + (ert-deftest . find-ert-deftest-regexp)) "Alist mapping definition types into regexp variables. Each regexp variable's value should actually be a format string to be used to substitute the desired symbol name into the regexp. |