Allow xt-mouse-tests to run

This is basically a workaround for running a test in batch mode
which should have a tty frame available but doesn't.

* src/frame.c (check_tty): Relax check if noninteractive.
* lisp/xt-mouse.el (xterm-mouse-event): Don't use frame-at if
noninteractive.
This commit is contained in:
Gerd Möllmann 2024-12-20 07:03:59 +01:00
parent 42ab0f162c
commit 82c3fcd17e
2 changed files with 11 additions and 1 deletions

View file

@ -295,7 +295,10 @@ which is the \"1006\" extension implemented in Xterm >= 277."
(progn (setq xt-mouse-epoch (float-time)) 0)
(car (time-convert (time-since xt-mouse-epoch)
1000))))
(frame (frame-at x y))
;; FIXME: The test for running in batch mode is here solely
;; for the sake of xt-mouse-tests where the only frame is
;; the initial frame.
(frame (unless noninteractive (frame-at x y)))
;;(_ (message (format "*** %S" frame)))
(frame-pos (frame-position frame))
;;(_ (message (format "*** %S" frame-pos)))

View file

@ -152,6 +152,13 @@ check_window_system (struct frame *f)
void
check_tty (struct frame *f)
{
/* FIXME: the noninteractive case is here because some tests running
in batch mode, like xt-mouse-tests, test with the initial frame
which is no tty frame. It would be nicer if the test harness
would allow testing with real tty frames. */
if (f && noninteractive)
return;
if (!f || !FRAME_TERMCAP_P (f))
error ("tty frame should be used");
}