mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-14 07:59:34 +00:00
Fix server-tests run noninteractively (bug#59742)
This may or may not fix the test run from CI. * test/lisp/server-tests.el (server-tests/can-create-frames-p): Don't attempt to create frames if TERM=dumb, which what we have if run from M-x compile (for instance). (server-tests/server-force-stop/keeps-frames): Delete created frame so that it doesn't cause trouble for other tests.
This commit is contained in:
parent
1b567f5a67
commit
4b3eb928fe
1 changed files with 11 additions and 4 deletions
|
@ -21,9 +21,12 @@
|
||||||
|
|
||||||
(require 'ert)
|
(require 'ert)
|
||||||
(require 'server)
|
(require 'server)
|
||||||
|
(require 'cl-lib)
|
||||||
|
|
||||||
(defconst server-tests/can-create-frames-p
|
(defconst server-tests/can-create-frames-p
|
||||||
(not (memq system-type '(windows-nt ms-dos)))
|
(and (not (memq system-type '(windows-nt ms-dos)))
|
||||||
|
;; TERM=dumb is what we get when running from `compile'.
|
||||||
|
(not (equal (getenv "TERM") "dumb")))
|
||||||
"Non-nil if we can create a new frame in the tests.
|
"Non-nil if we can create a new frame in the tests.
|
||||||
Some tests below need to create new frames for the emacsclient.
|
Some tests below need to create new frames for the emacsclient.
|
||||||
However, this doesn't work on all platforms. In particular,
|
However, this doesn't work on all platforms. In particular,
|
||||||
|
@ -188,7 +191,8 @@ tests that `server-force-stop' doesn't delete frames (and even
|
||||||
then, requires a few tricks to run as a regression test). So
|
then, requires a few tricks to run as a regression test). So
|
||||||
long as this works, the problem in bug#58877 shouldn't occur."
|
long as this works, the problem in bug#58877 shouldn't occur."
|
||||||
(skip-unless server-tests/can-create-frames-p)
|
(skip-unless server-tests/can-create-frames-p)
|
||||||
(let ((starting-frame-count (length (frame-list)))
|
(let* ((starting-frames (frame-list))
|
||||||
|
(starting-frame-count (length starting-frames))
|
||||||
terminal)
|
terminal)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(server-tests/with-server
|
(server-tests/with-server
|
||||||
|
@ -214,6 +218,9 @@ long as this works, the problem in bug#58877 shouldn't occur."
|
||||||
(when (and terminal
|
(when (and terminal
|
||||||
(eq (terminal-live-p terminal) t)
|
(eq (terminal-live-p terminal) t)
|
||||||
(not (eq system-type 'windows-nt)))
|
(not (eq system-type 'windows-nt)))
|
||||||
(delete-terminal terminal)))))
|
(delete-terminal terminal)))
|
||||||
|
;; Delete the created frame.
|
||||||
|
(delete-frame (car (cl-set-difference (frame-list) starting-frames))
|
||||||
|
t)))
|
||||||
|
|
||||||
;;; server-tests.el ends here
|
;;; server-tests.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue