Function: ert-results-pop-to-erts-file-tests-for-test-at-point
ert-results-pop-to-erts-file-tests-for-test-at-point is an interactive
and byte-compiled function defined in ert.el.gz.
Signature
(ert-results-pop-to-erts-file-tests-for-test-at-point)
Documentation
Display a buffer with the tests from erts files executed by the test at point.
For tests that call ert-test-erts-file, the list contains the tests
defined in the referenced erts files that have been executed. Tests
that were skipped are omitted. If a test fails, the list ends with the
failing test.
Each entry consists of the name of the test followed by the code that performs the transform being tested. The buffer also contains buttons that allow jumping to the test definitions.
To be used in the ERT results buffer. See Info node (ert) Running Tests Interactively for more information about how to use this feature.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/ert.el.gz
(defun ert-results-pop-to-erts-file-tests-for-test-at-point ()
"Display a buffer with the tests from erts files executed by the test at point.
For tests that call `ert-test-erts-file', the list contains the tests
defined in the referenced erts files that have been executed. Tests
that were skipped are omitted. If a test fails, the list ends with the
failing test.
Each entry consists of the name of the test followed by the code that
performs the transform being tested. The buffer also contains buttons
that allow jumping to the test definitions.
To be used in the ERT results buffer. See Info node `(ert) Running
Tests Interactively' for more information about how to use this feature."
(interactive nil ert-results-mode)
(let* ((test (ert--results-test-at-point-no-redefinition t))
(stats ert--results-stats)
(pos (ert--stats-test-pos stats test))
(result (aref (ert--stats-test-results stats) pos)))
(let ((buffer (get-buffer-create "*ERT list of tests from erts files*")))
(pop-to-buffer buffer)
(let ((inhibit-read-only t))
(buffer-disable-undo)
(erase-buffer)
(ert-simple-view-mode)
(if (null (ert-test-result-erts-file-tests result))
(insert "\n(No tests from erts files executed during this test.)\n")
(cl-loop for test-description
in (ert-test-result-erts-file-tests result)
for i from 1 do
(insert (format "\n%d: " i))
(insert-text-button (cdr (assq 'name test-description))
:type 'ert--erts-file-test-name-button
'file (cdr (assq 'file test-description))
'position (cdr (assq 'position test-description)))
(insert "\n\t")
(let* ((begin (point))
(desc-code (cdr (assq 'code test-description)))
(code (if (interpreted-function-p desc-code)
(macroexp-progn (aref desc-code 1))
desc-code)))
(ert--pp-with-indentation-and-newline code)
(ert--make-xrefs-region begin (point)))))
(goto-char (point-min))
(insert (substitute-command-keys
"tests from erts files executed during test `"))
(ert-insert-test-name-button (ert-test-name test))
(insert (substitute-command-keys "':\n"))
(forward-line 1)))))