From c5f819aa03427c0e2b86131d44fa55874da2b03e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 13 Dec 2022 20:06:48 +0100 Subject: [PATCH] Adapt Tramp specific tests in eglot-tests.el * test/lisp/progmodes/eglot-tests.el (tramp): Move up. (tramp-sh): Don't require. (eglot--cleanup-after-test): Delete Tramp buffers if needed. (eglot-tests-lsp-abiding-column): Rename from `eglot-lsp-abiding-column'. (tramp-histfile-override): Declare. (eglot--call-with-tramp-test): Use `ert-remote-temporary-file-directory'. Skip if needed. (eglot--tramp-test, eglot--tramp-test-2): Don't skip. --- test/lisp/progmodes/eglot-tests.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 518f8810bdf..725b877fd3c 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -1237,8 +1237,6 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of (defvar tramp-histfile-override) (defun eglot--call-with-tramp-test (fn) - (unless (>= emacs-major-version 27) - (ert-skip "Eglot Tramp support only on Emacs >= 27")) ;; Set up a Tramp method that’s just a shell so the remote host is ;; really just the local host. (let* ((tramp-remote-path (cons 'tramp-own-remote-path @@ -1260,6 +1258,9 @@ GUESSED-MAJOR-MODES-SYM are bound to the useful return values of (when (and noninteractive (not (file-directory-p "~/"))) (setenv "HOME" temporary-file-directory))))) (default-directory temporary-file-directory)) + ;; We must check the remote LSP server. So far, just "clangd" is used. + (unless (ignore-errors (executable-find "clangd" 'remote)) + (ert-skip "Remote clangd not found")) (funcall fn))) (ert-deftest eglot-test-tramp-test () -- 2.39.2