summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/ert.el
diff options
context:
space:
mode:
authorMichael R. Mauger <michael@mauger.com>2017-04-02 18:10:57 -0400
committerMichael R. Mauger <michael@mauger.com>2017-04-02 18:10:57 -0400
commit77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4 (patch)
tree27da92c2a61d664b700860c2d527a4d36000ca37 /lisp/emacs-lisp/ert.el
parentc5a31f8292c94d19b80a3dbe0b3026693cc1090e (diff)
parent8e394a7f35c2ba9297d222faa2689e177f268924 (diff)
downloademacs-77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4.tar.gz
emacs-77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4.tar.bz2
emacs-77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/emacs-lisp/ert.el')
-rw-r--r--lisp/emacs-lisp/ert.el22
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index cadd66ca6ed..e7387e463cb 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1236,7 +1236,7 @@ SELECTOR is the selector that was used to select TESTS."
(funcall listener 'test-ended stats test result))
(setf (ert--stats-current-test stats) nil))))
-(defun ert-run-tests (selector listener)
+(defun ert-run-tests (selector listener &optional interactively)
"Run the tests specified by SELECTOR, sending progress updates to LISTENER."
(let* ((tests (ert-select-tests selector t))
(stats (ert--make-stats tests selector)))
@@ -1247,10 +1247,14 @@ SELECTOR is the selector that was used to select TESTS."
(let ((ert--current-run-stats stats))
(force-mode-line-update)
(unwind-protect
- (progn
- (cl-loop for test in tests do
- (ert-run-or-rerun-test stats test listener))
- (setq abortedp nil))
+ (cl-loop for test in tests do
+ (ert-run-or-rerun-test stats test listener)
+ (when (and interactively
+ (ert-test-quit-p
+ (ert-test-most-recent-result test))
+ (y-or-n-p "Abort testing? "))
+ (cl-return))
+ finally (setq abortedp nil))
(setf (ert--stats-aborted-p stats) abortedp)
(setf (ert--stats-end-time stats) (current-time))
(funcall listener 'run-ended stats abortedp)))
@@ -1442,7 +1446,8 @@ Returns the stats object."
(ert-test-result-expected-p
test result))
(1+ (ert--stats-test-pos stats test))
- (ert-test-name test)))))))))
+ (ert-test-name test)))))))
+ nil))
;;;###autoload
(defun ert-run-tests-batch-and-exit (&optional selector)
@@ -2033,9 +2038,8 @@ and how to display message."
test result)))
(ert--results-update-stats-display-maybe ewoc stats)
(ewoc-invalidate ewoc node))))))))
- (ert-run-tests
- selector
- listener)))
+ (ert-run-tests selector listener t)))
+
;;;###autoload
(defalias 'ert 'ert-run-tests-interactively)