diff options
| author | Christian Ohler | 2011-03-03 01:16:58 -0700 |
|---|---|---|
| committer | Christian Ohler | 2011-03-03 01:16:58 -0700 |
| commit | 7c0d14414fd20b67f52cec2df87ca0601acf2c90 (patch) | |
| tree | 40398e81f551cd3ae49ddd03653a71bcf1d09c55 /lisp | |
| parent | c7a748017ace6b302ef79a077f6a646a2f27b85b (diff) | |
| download | emacs-7c0d14414fd20b67f52cec2df87ca0601acf2c90.tar.gz emacs-7c0d14414fd20b67f52cec2df87ca0601acf2c90.zip | |
Fix ERT bug related to quit handling.
* 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'.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 20 |
2 files changed, 21 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d933a2ea696..b4b7525872b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-03-03 Christian Ohler <ohler@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/ert.el (ert--stats-set-test-and-result) | ||
| 4 | (ert-char-for-test-result, ert-string-for-test-result) | ||
| 5 | (ert-run-tests-batch, ert--print-test-for-ewoc): | ||
| 6 | Handle `ert-test-quit'. | ||
| 7 | |||
| 1 | 2011-03-03 Bob Rogers <rogers-emacs@rgrjr.dyndns.org> | 8 | 2011-03-03 Bob Rogers <rogers-emacs@rgrjr.dyndns.org> |
| 2 | 9 | ||
| 3 | * vc/vc-dir.el (vc-dir-mode-map): Bind vc-dir-find-file to e. (Bug#7349) | 10 | * vc/vc-dir.el (vc-dir-mode-map): Bind vc-dir-find-file to e. (Bug#7349) |
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index b3c95fcc78f..9767ae7549e 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -1244,12 +1244,14 @@ Also changes the counters in STATS to match." | |||
| 1244 | (ert-test-passed (incf (ert--stats-passed-expected stats) d)) | 1244 | (ert-test-passed (incf (ert--stats-passed-expected stats) d)) |
| 1245 | (ert-test-failed (incf (ert--stats-failed-expected stats) d)) | 1245 | (ert-test-failed (incf (ert--stats-failed-expected stats) d)) |
| 1246 | (null) | 1246 | (null) |
| 1247 | (ert-test-aborted-with-non-local-exit)) | 1247 | (ert-test-aborted-with-non-local-exit) |
| 1248 | (ert-test-quit)) | ||
| 1248 | (etypecase (aref results pos) | 1249 | (etypecase (aref results pos) |
| 1249 | (ert-test-passed (incf (ert--stats-passed-unexpected stats) d)) | 1250 | (ert-test-passed (incf (ert--stats-passed-unexpected stats) d)) |
| 1250 | (ert-test-failed (incf (ert--stats-failed-unexpected stats) d)) | 1251 | (ert-test-failed (incf (ert--stats-failed-unexpected stats) d)) |
| 1251 | (null) | 1252 | (null) |
| 1252 | (ert-test-aborted-with-non-local-exit))))) | 1253 | (ert-test-aborted-with-non-local-exit) |
| 1254 | (ert-test-quit))))) | ||
| 1253 | ;; Adjust counters to remove the result that is currently in stats. | 1255 | ;; Adjust counters to remove the result that is currently in stats. |
| 1254 | (update -1) | 1256 | (update -1) |
| 1255 | ;; Put new test and result into stats. | 1257 | ;; Put new test and result into stats. |
| @@ -1342,7 +1344,8 @@ EXPECTEDP specifies whether the result was expected." | |||
| 1342 | (ert-test-passed ".P") | 1344 | (ert-test-passed ".P") |
| 1343 | (ert-test-failed "fF") | 1345 | (ert-test-failed "fF") |
| 1344 | (null "--") | 1346 | (null "--") |
| 1345 | (ert-test-aborted-with-non-local-exit "aA")))) | 1347 | (ert-test-aborted-with-non-local-exit "aA") |
| 1348 | (ert-test-quit "qQ")))) | ||
| 1346 | (elt s (if expectedp 0 1)))) | 1349 | (elt s (if expectedp 0 1)))) |
| 1347 | 1350 | ||
| 1348 | (defun ert-string-for-test-result (result expectedp) | 1351 | (defun ert-string-for-test-result (result expectedp) |
| @@ -1353,7 +1356,8 @@ EXPECTEDP specifies whether the result was expected." | |||
| 1353 | (ert-test-passed '("passed" "PASSED")) | 1356 | (ert-test-passed '("passed" "PASSED")) |
| 1354 | (ert-test-failed '("failed" "FAILED")) | 1357 | (ert-test-failed '("failed" "FAILED")) |
| 1355 | (null '("unknown" "UNKNOWN")) | 1358 | (null '("unknown" "UNKNOWN")) |
| 1356 | (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED"))))) | 1359 | (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED")) |
| 1360 | (ert-test-quit '("quit" "QUIT"))))) | ||
| 1357 | (elt s (if expectedp 0 1)))) | 1361 | (elt s (if expectedp 0 1)))) |
| 1358 | 1362 | ||
| 1359 | (defun ert--pp-with-indentation-and-newline (object) | 1363 | (defun ert--pp-with-indentation-and-newline (object) |
| @@ -1478,7 +1482,9 @@ Returns the stats object." | |||
| 1478 | (message "%s" (buffer-string)))) | 1482 | (message "%s" (buffer-string)))) |
| 1479 | (ert-test-aborted-with-non-local-exit | 1483 | (ert-test-aborted-with-non-local-exit |
| 1480 | (message "Test %S aborted with non-local exit" | 1484 | (message "Test %S aborted with non-local exit" |
| 1481 | (ert-test-name test))))) | 1485 | (ert-test-name test))) |
| 1486 | (ert-test-quit | ||
| 1487 | (message "Quit during %S" (ert-test-name test))))) | ||
| 1482 | (let* ((max (prin1-to-string (length (ert--stats-tests stats)))) | 1488 | (let* ((max (prin1-to-string (length (ert--stats-tests stats)))) |
| 1483 | (format-string (concat "%9s %" | 1489 | (format-string (concat "%9s %" |
| 1484 | (prin1-to-string (length max)) | 1490 | (prin1-to-string (length max)) |
| @@ -1853,7 +1859,9 @@ non-nil, returns the face for expected results.." | |||
| 1853 | (ert-test-result-with-condition-condition result)) | 1859 | (ert-test-result-with-condition-condition result)) |
| 1854 | (ert--make-xrefs-region begin (point))))) | 1860 | (ert--make-xrefs-region begin (point))))) |
| 1855 | (ert-test-aborted-with-non-local-exit | 1861 | (ert-test-aborted-with-non-local-exit |
| 1856 | (insert " aborted\n"))) | 1862 | (insert " aborted\n")) |
| 1863 | (ert-test-quit | ||
| 1864 | (insert " quit\n"))) | ||
| 1857 | (insert "\n"))))) | 1865 | (insert "\n"))))) |
| 1858 | nil) | 1866 | nil) |
| 1859 | 1867 | ||