; Fix a failure when running server-tests via the command line

* test/lisp/server-tests.el
(server-tests/server-force-stop/keeps-frames): Delete every new frame
created during the test.  On some systems, 'delete-terminal' will
delete the frames for us, so this ensures that if there are no new
frames, nothing happens.

(cherry picked from commit 3785fe52e4)
This commit is contained in:
Jim Porter 2022-12-09 22:56:24 -08:00 committed by Mattias Engdegård
parent 44c5f36149
commit 1b7ece2095

View file

@ -218,8 +218,8 @@ long as this works, the problem in bug#58877 shouldn't occur."
(eq (terminal-live-p terminal) t)
(not (eq system-type 'windows-nt)))
(delete-terminal terminal)))
;; Delete the created frame.
(delete-frame (car (cl-set-difference (frame-list) starting-frames))
t)))
;; If there are any new frames remaining, delete them.
(mapc (lambda (frame) (delete-frame frame t))
(cl-set-difference (frame-list) starting-frames))))
;;; server-tests.el ends here