unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: Some testing issues
Date: Sat, 08 Jul 2017 16:51:28 +0200	[thread overview]
Message-ID: <87y3rznfrj.fsf@rosalinde> (raw)
In-Reply-To: <59608730.3050308@gmx.at> (martin rudalics's message of "Sat, 08 Jul 2017 09:18:08 +0200")

On Sat, 08 Jul 2017 09:18:08 +0200 martin rudalics <rudalics@gmx.at> wrote:

>> And lastly, in one case, the test succeeds
>> without the set-window-buffer call when run interactively, but fails
>> without it when run in batch mode from the shell.  Any idea what's going
>> on here?  (If anyone wants to take a closer look, comments in the test
>> file point out the problematic cases.)
>
> The interactive call might succeed because command_loop_1 makes the
> selected window's buffer current in
>
>       set_buffer_internal (XBUFFER (XWINDOW (selected_window)->contents));
>
> Supposedly, testing ‘recenter’ doesn't make much sense without a frame.

True, though when I step through the code in the interactive test, the
condition (pos-visible-in-window-p shown) is true, so recenter is not
called; so the question to me is why this is not the case in the batch run.

>> A second problem concerns trying to reference a message in a test.  The
>> function todo-toggle-view-done-items outputs a message if the category
>> contains no done items, and the test captures this by calling
>> current-message immediately after todo-toggle-view-done-items.  This
>> works when running the test interactively, but in a batch run,
>> current-message is nil (though the message is output in the shell).
>> Why?  (I avoid the failure in batch mode by testing a different but
>> effectively equivalent condition.)
>
> ‘current-message’ returns "the string currently displayed in the echo
> area" and there's no echo area in batch mode.

Yes, as Noam also pointed out; I didn't think carefully enough about the
use of current-message.

>> Finally, one of the tests involves a display overlay that hides the item
>> header, which as a consequence, when using todo-mode, prevented the
>> cursor from appearing where the code put point, resulting in a display
>> bug.  I fixed this (in master 264dd81) by moving point to the first
>> visible position after the overlay.  But when running the test, the
>> overlay evidently does not inhibit point, but since the test, following
>> the bugfix code in todo-mode.el, assumes it does, it fails.  It seems
>> that the test environment does not reflect the same display mechanisms
>> that using the code does.  I haven't found a solution or workaround for
>> this, so the test is currently marked ":expected-result :failed".  I
>> hope someone can come up with a better alternative.
>
> You need a frame to display something and there's none in batch mode.
> Hence you can't test display features in batch mode.

Thanks for clarifying that for me.  I guess I'll have to leave such
features untested, or is there an alternative?

Thanks for the feedback.

Steve Berman



  reply	other threads:[~2017-07-08 14:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 21:22 Some testing issues Stephen Berman
2017-07-08  4:20 ` Noam Postavsky
2017-07-08 14:50   ` Stephen Berman
2017-07-08 22:01     ` Noam Postavsky
2017-07-14  9:55       ` Stephen Berman
2017-07-08  4:45 ` Stefan Monnier
2017-07-08 14:52   ` Stephen Berman
2017-07-10 17:33     ` Stefan Monnier
2017-07-14  9:56       ` Stephen Berman
2017-07-14 13:44         ` Stefan Monnier
2017-07-17 10:02           ` Stephen Berman
2017-07-17 18:22             ` Stefan Monnier
2017-07-08  7:18 ` martin rudalics
2017-07-08 14:51   ` Stephen Berman [this message]
2017-07-09  7:46     ` martin rudalics
2017-07-14  9:55       ` Stephen Berman

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=87y3rznfrj.fsf@rosalinde \
    --to=stephen.berman@gmx.net \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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).