unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
       [not found] ` <20190726075904.0A44C20C06@vcs0.savannah.gnu.org>
@ 2019-07-26 15:19   ` Basil L. Contovounesios
  2019-07-26 15:25     ` Basil L. Contovounesios
  2019-07-27 10:07     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-07-26 15:19 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

[-- 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
  2019-07-26 15:19   ` [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too Basil L. Contovounesios
@ 2019-07-26 15:25     ` Basil L. Contovounesios
  2019-07-27 10:07     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-07-26 15:25 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> 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)))

Er, obviously 'nunexpected' can be incremented within the 'unless' as
well.

-- 
Basil



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
  2019-07-26 15:19   ` [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too Basil L. Contovounesios
  2019-07-26 15:25     ` Basil L. Contovounesios
@ 2019-07-27 10:07     ` Lars Ingebrigtsen
  2019-07-27 11:58       ` Basil L. Contovounesios
  1 sibling, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-27 10:07 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: emacs-devel

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> 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'?

Right; sorry.

> 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

Looks like Paul made a similar change to fix this already...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
  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
  0 siblings, 2 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-07-27 11:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> larsi@gnus.org (Lars Ingebrigtsen) writes:
>>
>> 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
>
> Looks like Paul made a similar change to fix this already...

Indeed (thanks Paul), but what about this question:

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

Do these need to be updated for consistency with the other reporting
functions?

Thanks,

-- 
Basil



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
  2019-07-27 11:58       ` Basil L. Contovounesios
@ 2019-07-27 12:04         ` Lars Ingebrigtsen
  2019-07-27 14:23         ` Paul Eggert
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-27 12:04 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: emacs-devel

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

>>> What about ert-run-tests-interactively and
>>> ert--results-format-expected-unexpected?
>
> Do these need to be updated for consistency with the other reporting
> functions?

Sorry; missed that bit.

Oh, there's even more places that do basically the same reporting, and
in the same style?  Yes, those should also be updated.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too
  2019-07-27 11:58       ` Basil L. Contovounesios
  2019-07-27 12:04         ` Lars Ingebrigtsen
@ 2019-07-27 14:23         ` Paul Eggert
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Eggert @ 2019-07-27 14:23 UTC (permalink / raw)
  To: Basil L. Contovounesios, Lars Ingebrigtsen; +Cc: emacs-devel

Basil L. Contovounesios wrote:
> Do these need to be updated for consistency with the other reporting
> functions?

I suppose so; I haven't used them. Please feel free to fix them too.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-27 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190726075902.16162.83489@vcs0.savannah.gnu.org>
     [not found] ` <20190726075904.0A44C20C06@vcs0.savannah.gnu.org>
2019-07-26 15:19   ` [Emacs-diffs] master 66db7b2 1/2: Always include the number of unexpected results here too Basil L. Contovounesios
2019-07-26 15:25     ` 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

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).