aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/ert.el26
1 files changed, 8 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index a15450734ec..e4e166ac678 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1342,9 +1342,6 @@ RESULT must be an `ert-test-result-with-condition'."
1342(defvar ert-quiet nil 1342(defvar ert-quiet nil
1343 "Non-nil makes ERT only print important information in batch mode.") 1343 "Non-nil makes ERT only print important information in batch mode.")
1344 1344
1345(defvar ert-batch-print-duration nil
1346 "Non-nil makes ERT print duration time of single tests in batch mode.")
1347
1348;;;###autoload 1345;;;###autoload
1349(defun ert-run-tests-batch (&optional selector) 1346(defun ert-run-tests-batch (&optional selector)
1350 "Run the tests specified by SELECTOR, printing results to the terminal. 1347 "Run the tests specified by SELECTOR, printing results to the terminal.
@@ -1371,7 +1368,7 @@ Returns the stats object."
1371 (let ((unexpected (ert-stats-completed-unexpected stats)) 1368 (let ((unexpected (ert-stats-completed-unexpected stats))
1372 (skipped (ert-stats-skipped stats)) 1369 (skipped (ert-stats-skipped stats))
1373 (expected-failures (ert--stats-failed-expected stats))) 1370 (expected-failures (ert--stats-failed-expected stats)))
1374 (message "\n%sRan %s tests, %s results as expected%s%s (%s)%s\n" 1371 (message "\n%sRan %s tests, %s results as expected%s%s (%s, %f sec)%s\n"
1375 (if (not abortedp) 1372 (if (not abortedp)
1376 "" 1373 ""
1377 "Aborted: ") 1374 "Aborted: ")
@@ -1383,15 +1380,11 @@ Returns the stats object."
1383 (if (zerop skipped) 1380 (if (zerop skipped)
1384 "" 1381 ""
1385 (format ", %s skipped" skipped)) 1382 (format ", %s skipped" skipped))
1386 (if ert-batch-print-duration 1383 (ert--format-time-iso8601 (ert--stats-end-time stats))
1387 (format 1384 (float-time
1388 "%s, %f sec" 1385 (time-subtract
1389 (ert--format-time-iso8601 (ert--stats-end-time stats)) 1386 (ert--stats-end-time stats)
1390 (float-time 1387 (ert--stats-start-time stats)))
1391 (time-subtract
1392 (ert--stats-end-time stats)
1393 (ert--stats-start-time stats))))
1394 (ert--format-time-iso8601 (ert--stats-end-time stats)))
1395 (if (zerop expected-failures) 1388 (if (zerop expected-failures)
1396 "" 1389 ""
1397 (format "\n%s expected failures" expected-failures))) 1390 (format "\n%s expected failures" expected-failures)))
@@ -1463,17 +1456,14 @@ Returns the stats object."
1463 (let* ((max (prin1-to-string (length (ert--stats-tests stats)))) 1456 (let* ((max (prin1-to-string (length (ert--stats-tests stats))))
1464 (format-string (concat "%9s %" 1457 (format-string (concat "%9s %"
1465 (prin1-to-string (length max)) 1458 (prin1-to-string (length max))
1466 "s/" max " %S" 1459 "s/" max " %S (%f sec)")))
1467 (if ert-batch-print-duration
1468 " (%f sec)"))))
1469 (message format-string 1460 (message format-string
1470 (ert-string-for-test-result result 1461 (ert-string-for-test-result result
1471 (ert-test-result-expected-p 1462 (ert-test-result-expected-p
1472 test result)) 1463 test result))
1473 (1+ (ert--stats-test-pos stats test)) 1464 (1+ (ert--stats-test-pos stats test))
1474 (ert-test-name test) 1465 (ert-test-name test)
1475 (if ert-batch-print-duration 1466 (ert-test-result-duration result))))))))
1476 (ert-test-result-duration result)))))))))
1477 nil)) 1467 nil))
1478 1468
1479;;;###autoload 1469;;;###autoload