diff options
| author | Basil L. Contovounesios | 2023-04-10 10:58:49 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2023-04-10 11:03:33 +0100 |
| commit | ab8153b3bbafe2a06c0a4dffeab83448dc3e5600 (patch) | |
| tree | 986448deace6fec3acc0c71bafbb05889aafb26f | |
| parent | ba7ef9699ff21667f8b242e294616f0a255ede22 (diff) | |
| download | emacs-ab8153b3bbafe2a06c0a4dffeab83448dc3e5600.tar.gz emacs-ab8153b3bbafe2a06c0a4dffeab83448dc3e5600.zip | |
Clarify process-environment in eglot-tests
* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Clarify commentary (bug#61637). Use null-device and briefer syntax.
| -rw-r--r-- | test/lisp/progmodes/eglot-tests.el | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index ad0a411189f..efb0f4d8844 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el | |||
| @@ -92,24 +92,24 @@ directory hierarchy." | |||
| 92 | test-body-successful-p) | 92 | test-body-successful-p) |
| 93 | (eglot--test-message "[%s]: test start" (ert-test-name (ert-running-test))) | 93 | (eglot--test-message "[%s]: test start" (ert-test-name (ert-running-test))) |
| 94 | (unwind-protect | 94 | (unwind-protect |
| 95 | (let* ((process-environment | 95 | (let ((process-environment |
| 96 | (append | 96 | `(;; Set XDG_CONFIG_HOME to /dev/null to prevent |
| 97 | `(;; Set XDF_CONFIG_HOME to /dev/null to prevent | 97 | ;; user-configuration influencing language servers |
| 98 | ;; user-configuration to have an influence on | 98 | ;; (see github#441). |
| 99 | ;; language servers. (See github#441) | 99 | ,(format "XDG_CONFIG_HOME=%s" null-device) |
| 100 | "XDG_CONFIG_HOME=/dev/null" | 100 | ;; ... on the flip-side, a similar technique in |
| 101 | ;; ... on the flip-side, a similar technique by | 101 | ;; Emacs's `test/Makefile' spoofs HOME as |
| 102 | ;; Emacs's test makefiles means that HOME is | 102 | ;; /nonexistent (and as `temporary-file-directory' in |
| 103 | ;; spoofed to /nonexistent, or sometimes /tmp. | 103 | ;; `ert-remote-temporary-file-directory'). |
| 104 | ;; This breaks some common installations for LSP | 104 | ;; This breaks some common installations for LSP |
| 105 | ;; servers like pylsp, rust-analyzer making these | 105 | ;; servers like rust-analyzer, making these tests |
| 106 | ;; tests mostly useless, so we hack around it here | 106 | ;; mostly useless, so we hack around it here with a |
| 107 | ;; with a great big hack. | 107 | ;; great big hack. |
| 108 | ,(format "HOME=%s" | 108 | ,(format "HOME=%s" |
| 109 | (expand-file-name (format "~%s" (user-login-name))))) | 109 | (expand-file-name (format "~%s" (user-login-name)))) |
| 110 | process-environment)) | 110 | ,@process-environment)) |
| 111 | (eglot-server-initialized-hook | 111 | (eglot-server-initialized-hook |
| 112 | (lambda (server) (push server new-servers)))) | 112 | (lambda (server) (push server new-servers)))) |
| 113 | (setq created-files (mapcan #'eglot--make-file-or-dir fixture)) | 113 | (setq created-files (mapcan #'eglot--make-file-or-dir fixture)) |
| 114 | (prog1 (funcall fn) | 114 | (prog1 (funcall fn) |
| 115 | (setq test-body-successful-p t))) | 115 | (setq test-body-successful-p t))) |