unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: emacs-devel@gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
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	[thread overview]
Message-ID: <87sgqs4ye0.fsf@tcd.ie> (raw)
In-Reply-To: <20190726075904.0A44C20C06@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Fri, 26 Jul 2019 03:59:03 -0400 (EDT)")

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

larsi@gnus.org (Lars Ingebrigtsen) writes:

> branch: master
> commit 66db7b2c36c9189baf6f6b3d3fd7d04b3903cab4
> Author: Lars Ingebrigtsen <larsi@gnus.org>
> Commit: Lars Ingebrigtsen <larsi@gnus.org>
>
>     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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ert-unexpected.diff --]
[-- Type: text/x-diff, Size: 1264 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 105 bytes --]


What about ert-run-tests-interactively and
ert--results-format-expected-unexpected?

Thanks,

-- 
Basil

       reply	other threads:[~2019-07-26 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190726075902.16162.83489@vcs0.savannah.gnu.org>
     [not found] ` <20190726075904.0A44C20C06@vcs0.savannah.gnu.org>
2019-07-26 15:19   ` Basil L. Contovounesios [this message]
2019-07-26 15:25     ` [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too Basil L. Contovounesios
2019-07-27 10:07     ` Lars Ingebrigtsen
2019-07-27 11:58       ` Basil L. Contovounesios
2019-07-27 12:04         ` Lars Ingebrigtsen
2019-07-27 14:23         ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgqs4ye0.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).