From: João Távora Date: Tue, 21 Mar 2023 18:43:58 +0000 (+0000) Subject: Skip Eglot test if using very old clangd X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d5036061b544f5a306ccd275502f608ec9d3f25;p=emacs.git 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. --- 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;}"))))