diff options
| author | Glenn Morris | 2016-05-16 20:49:39 -0400 |
|---|---|---|
| committer | Glenn Morris | 2016-05-16 20:49:39 -0400 |
| commit | d90c3a742f7102ca6d2949c9f31ea1285da882fd (patch) | |
| tree | b0b753155d97725f51dd5d0c1aee5d8bcf5335dd | |
| parent | 2d57359d2d3fd1674ee3fe7fec24c404e3e01d41 (diff) | |
| download | emacs-d90c3a742f7102ca6d2949c9f31ea1285da882fd.tar.gz emacs-d90c3a742f7102ca6d2949c9f31ea1285da882fd.zip | |
* lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit):
Include more details on hydra.
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 3d1b060494b..f5417c2100f 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -1470,7 +1470,7 @@ this exits Emacs, with status as per `ert-run-tests-batch-and-exit'." | |||
| 1470 | (user-error "This function is only for use in batch mode")) | 1470 | (user-error "This function is only for use in batch mode")) |
| 1471 | (let ((nlogs (length command-line-args-left)) | 1471 | (let ((nlogs (length command-line-args-left)) |
| 1472 | (ntests 0) (nrun 0) (nexpected 0) (nunexpected 0) (nskipped 0) | 1472 | (ntests 0) (nrun 0) (nexpected 0) (nunexpected 0) (nskipped 0) |
| 1473 | nnotrun logfile notests badtests unexpected) | 1473 | nnotrun logfile notests badtests unexpected skipped) |
| 1474 | (with-temp-buffer | 1474 | (with-temp-buffer |
| 1475 | (while (setq logfile (pop command-line-args-left)) | 1475 | (while (setq logfile (pop command-line-args-left)) |
| 1476 | (erase-buffer) | 1476 | (erase-buffer) |
| @@ -1490,9 +1490,10 @@ Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\ | |||
| 1490 | (push logfile unexpected) | 1490 | (push logfile unexpected) |
| 1491 | (setq nunexpected (+ nunexpected | 1491 | (setq nunexpected (+ nunexpected |
| 1492 | (string-to-number (match-string 4))))) | 1492 | (string-to-number (match-string 4))))) |
| 1493 | (if (match-string 5) | 1493 | (when (match-string 5) |
| 1494 | (setq nskipped (+ nskipped | 1494 | (push logfile skipped) |
| 1495 | (string-to-number (match-string 5))))))))) | 1495 | (setq nskipped (+ nskipped |
| 1496 | (string-to-number (match-string 5))))))))) | ||
| 1496 | (setq nnotrun (- ntests nrun)) | 1497 | (setq nnotrun (- ntests nrun)) |
| 1497 | (message "\nSUMMARY OF TEST RESULTS") | 1498 | (message "\nSUMMARY OF TEST RESULTS") |
| 1498 | (message "-----------------------") | 1499 | (message "-----------------------") |
| @@ -1516,6 +1517,26 @@ Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\ | |||
| 1516 | (when unexpected | 1517 | (when unexpected |
| 1517 | (message "%d files contained unexpected results:" (length unexpected)) | 1518 | (message "%d files contained unexpected results:" (length unexpected)) |
| 1518 | (mapc (lambda (l) (message " %s" l)) unexpected)) | 1519 | (mapc (lambda (l) (message " %s" l)) unexpected)) |
| 1520 | ;; More details on hydra, where the logs are harder to get to. | ||
| 1521 | (when (and (getenv "HOME") | ||
| 1522 | (not (zerop (+ nunexpected nskipped)))) | ||
| 1523 | (message "\nDETAILS") | ||
| 1524 | (message "-------") | ||
| 1525 | (with-temp-buffer | ||
| 1526 | (dolist (x (list (list skipped "skipped" "SKIPPED") | ||
| 1527 | (list unexpected "unexpected" "FAILED"))) | ||
| 1528 | (mapc (lambda (l) | ||
| 1529 | (erase-buffer) | ||
| 1530 | (insert-file-contents l) | ||
| 1531 | (message "%s:" l) | ||
| 1532 | (when (re-search-forward (format "^[ \t]*[0-9]+ %s results:" | ||
| 1533 | (nth 1 x)) | ||
| 1534 | nil t) | ||
| 1535 | (while (and (zerop (forward-line 1)) | ||
| 1536 | (looking-at (format "^[ \t]*%s" (nth 2 x)))) | ||
| 1537 | (message "%s" (buffer-substring (line-beginning-position) | ||
| 1538 | (line-end-position)))))) | ||
| 1539 | (car x))))) | ||
| 1519 | (kill-emacs (cond ((or notests badtests (not (zerop nnotrun))) 2) | 1540 | (kill-emacs (cond ((or notests badtests (not (zerop nnotrun))) 2) |
| 1520 | (unexpected 1) | 1541 | (unexpected 1) |
| 1521 | (t 0))))) | 1542 | (t 0))))) |