[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some testing issues
From: |
martin rudalics |
Subject: |
Re: Some testing issues |
Date: |
Sat, 08 Jul 2017 09:18:08 +0200 |
> 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.
> 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.
> 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.
martin
- Re: Some testing issues, (continued)
Re: Some testing issues, Stefan Monnier, 2017/07/08
- Re: Some testing issues, Stephen Berman, 2017/07/08
- Re: Some testing issues, Stefan Monnier, 2017/07/10
- Re: Some testing issues, Stephen Berman, 2017/07/14
- Re: Some testing issues, Stefan Monnier, 2017/07/14
- Re: Some testing issues, Stephen Berman, 2017/07/17
- Re: Some testing issues, Stefan Monnier, 2017/07/17
Re: Some testing issues,
martin rudalics <=