]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix ERT bug related to quit handling.
authorChristian Ohler <ohler@gnu.org>
Thu, 3 Mar 2011 08:16:58 +0000 (01:16 -0700)
committerChristian Ohler <ohler@gnu.org>
Thu, 3 Mar 2011 08:16:58 +0000 (01:16 -0700)
* emacs-lisp/ert.el (ert--stats-set-test-and-result)
(ert-char-for-test-result, ert-string-for-test-result)
(ert-run-tests-batch, ert--print-test-for-ewoc):
Handle `ert-test-quit'.

lisp/ChangeLog
lisp/emacs-lisp/ert.el

index d933a2ea6969220ffb396f6d366e677b6a4bbbb5..b4b7525872ba03ed947bb99c1f3d88e1bb68f221 100644 (file)
@@ -1,3 +1,10 @@
+2011-03-03  Christian Ohler  <ohler@gnu.org>
+
+       * emacs-lisp/ert.el (ert--stats-set-test-and-result)
+       (ert-char-for-test-result, ert-string-for-test-result)
+       (ert-run-tests-batch, ert--print-test-for-ewoc):
+       Handle `ert-test-quit'.
+
 2011-03-03  Bob Rogers  <rogers-emacs@rgrjr.dyndns.org>
 
        * vc/vc-dir.el (vc-dir-mode-map): Bind vc-dir-find-file to e. (Bug#7349)
index b3c95fcc78f0c334ace5a9799f1dd9ea0172e625..9767ae7549e5dbc9e2a7781d233407c3c417dfea 100644 (file)
@@ -1244,12 +1244,14 @@ Also changes the counters in STATS to match."
                    (ert-test-passed (incf (ert--stats-passed-expected stats) d))
                    (ert-test-failed (incf (ert--stats-failed-expected stats) d))
                    (null)
-                   (ert-test-aborted-with-non-local-exit))
+                   (ert-test-aborted-with-non-local-exit)
+                   (ert-test-quit))
                (etypecase (aref results pos)
                  (ert-test-passed (incf (ert--stats-passed-unexpected stats) d))
                  (ert-test-failed (incf (ert--stats-failed-unexpected stats) d))
                  (null)
-                 (ert-test-aborted-with-non-local-exit)))))
+                 (ert-test-aborted-with-non-local-exit)
+                 (ert-test-quit)))))
       ;; Adjust counters to remove the result that is currently in stats.
       (update -1)
       ;; Put new test and result into stats.
@@ -1342,7 +1344,8 @@ EXPECTEDP specifies whether the result was expected."
              (ert-test-passed ".P")
              (ert-test-failed "fF")
              (null "--")
-             (ert-test-aborted-with-non-local-exit "aA"))))
+             (ert-test-aborted-with-non-local-exit "aA")
+             (ert-test-quit "qQ"))))
     (elt s (if expectedp 0 1))))
 
 (defun ert-string-for-test-result (result expectedp)
@@ -1353,7 +1356,8 @@ EXPECTEDP specifies whether the result was expected."
              (ert-test-passed '("passed" "PASSED"))
              (ert-test-failed '("failed" "FAILED"))
              (null '("unknown" "UNKNOWN"))
-             (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED")))))
+             (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED"))
+             (ert-test-quit '("quit" "QUIT")))))
     (elt s (if expectedp 0 1))))
 
 (defun ert--pp-with-indentation-and-newline (object)
@@ -1478,7 +1482,9 @@ Returns the stats object."
                  (message "%s" (buffer-string))))
               (ert-test-aborted-with-non-local-exit
                (message "Test %S aborted with non-local exit"
-                        (ert-test-name test)))))
+                        (ert-test-name test)))
+              (ert-test-quit
+               (message "Quit during %S" (ert-test-name test)))))
           (let* ((max (prin1-to-string (length (ert--stats-tests stats))))
                  (format-string (concat "%9s  %"
                                         (prin1-to-string (length max))
@@ -1853,7 +1859,9 @@ non-nil, returns the face for expected results.."
                      (ert-test-result-with-condition-condition result))
                     (ert--make-xrefs-region begin (point)))))
                (ert-test-aborted-with-non-local-exit
-                (insert "    aborted\n")))
+                (insert "    aborted\n"))
+               (ert-test-quit
+                (insert "    quit\n")))
              (insert "\n")))))
   nil)