emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexp


From: Basil L. Contovounesios
Subject: Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
Date: Fri, 26 Jul 2019 16:19:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

address@hidden (Lars Ingebrigtsen) writes:

> branch: master
> commit 66db7b2c36c9189baf6f6b3d3fd7d04b3903cab4
> Author: Lars Ingebrigtsen <address@hidden>
> Commit: Lars Ingebrigtsen <address@hidden>
>
>     Always include the number of unexpected results here too

Doesn't this break 'make check'?

AFAICT ert-summarize-tests-batch-and-exit currently uses the presence of
"N unexpected" as an indication of an error, even when N is zero:

  (if (not (re-search-forward "^\\(Aborted: \\)?\
Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\
\\(?:, \\([0-9]+\\) unexpected\\)?\
\\(?:, \\([0-9]+\\) skipped\\)?" nil t))
      (push logfile badtests)
    ...
    (when (match-string 4)
      (push logfile unexpected)
      (setq nunexpected (+ nunexpected
                           (string-to-number (match-string 4)))))
    ...)

Should this be updated as follows?

diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 272fd4aec2..c659e4f3fc 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1496,16 +1496,16 @@ ert-summarize-tests-batch-and-exit
           (setq ntests (+ ntests (string-to-number (match-string 1))))
           (if (not (re-search-forward "^\\(Aborted: \\)?\
 Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\
-\\(?:, \\([0-9]+\\) unexpected\\)?\
+, \\([0-9]+\\) unexpected\
 \\(?:, \\([0-9]+\\) skipped\\)?" nil t))
               (push logfile badtests)
             (if (match-string 1) (push logfile badtests))
             (setq nrun (+ nrun (string-to-number (match-string 2)))
                   nexpected (+ nexpected (string-to-number (match-string 3))))
-            (when (match-string 4)
-              (push logfile unexpected)
-              (setq nunexpected (+ nunexpected
-                                   (string-to-number (match-string 4)))))
+            (let ((n (string-to-number (match-string 4))))
+              (setq nunexpected (+ nunexpected n))
+              (unless (zerop n)
+                (push logfile unexpected)))
             (when (match-string 5)
               (push logfile skipped)
               (setq nskipped (+ nskipped
What about ert-run-tests-interactively and
ert--results-format-expected-unexpected?

Thanks,

-- 
Basil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]