From 0d5036061b544f5a306ccd275502f608ec9d3f25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 21 Mar 2023 18:43:58 +0000 Subject: [PATCH] Skip Eglot test if using very old clangd * test/lisp/progmodes/eglot-tests.el (eglot--clangd-version): New helper. (eglot-test-diagnostic-tags-unnecessary-code): Use it. --- test/lisp/progmodes/eglot-tests.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index 7ac26732737..c4b23bfd64e 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -314,6 +314,12 @@ then restored." (setq last-command-event char) (call-interactively (key-binding (vector char)))) +(defun eglot--clangd-version () + "Report on the clangd version used in various tests." + (replace-regexp-in-string + ".*version[[:space:]]+\\(.*\\)" "\\1" + (car (split-string (shell-command-to-string "clangd --version") "\n")))) + ;;; Unit tests @@ -452,6 +458,7 @@ then restored." (ert-deftest eglot-test-diagnostic-tags-unnecessary-code () "Test rendering of diagnostics tagged \"unnecessary\"." (skip-unless (executable-find "clangd")) + (skip-unless (version<= "14" (eglot--clangd-version))) (eglot--with-fixture `(("diag-project" . (("main.cpp" . "int main(){float a = 42.2; return 0;}")))) -- 2.39.5