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.
This commit is contained in:
Michael Albinus 2022-12-13 20:06:48 +01:00
parent 075e77ac44
commit c5f819aa03

View file

@ -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 thats 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 ()