Function: ert--run-test-internal

ert--run-test-internal is a byte-compiled function defined in ert.el.gz.

Signature

(ert--run-test-internal TEST-EXECUTION-INFO)

Documentation

Low-level function to run a test according to TEST-EXECUTION-INFO.

This mainly sets up debugger-related bindings.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/ert.el.gz
(defun ert--run-test-internal (test-execution-info)
  "Low-level function to run a test according to TEST-EXECUTION-INFO.

This mainly sets up debugger-related bindings."
  (setf (ert--test-execution-info-ert-debug-on-error test-execution-info)
        ert-debug-on-error)
  (catch 'ert--pass
    ;; For now, each test gets its own temp buffer and its own
    ;; window excursion, just to be safe.  If this turns out to be
    ;; too expensive, we can remove it.
    (with-temp-buffer
      (save-window-excursion
        (let ((lexical-binding t) ;;FIXME: Why?
              (ert--infos '()))
          (letrec ((debugfun (lambda (err)
                               (ert--run-test-debugger test-execution-info
                                                       err debugfun))))
            (handler-bind ((t debugfun))
              (funcall (ert-test-body (ert--test-execution-info-test
                                       test-execution-info))))))))
    (ert-pass))
  (setf (ert--test-execution-info-result test-execution-info)
        (make-ert-test-passed))
  nil)