emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eglot-test-diagnostic-tags-unnecessary-code fails with certain clang


From: João Távora
Subject: Re: eglot-test-diagnostic-tags-unnecessary-code fails with certain clangd versions
Date: Tue, 21 Mar 2023 14:07:19 +0000

On Tue, Mar 21, 2023 at 1:49 PM Robert Pluim <rpluim@gmail.com> wrote:
>
> >>>>> On Tue, 21 Mar 2023 14:08:39 +0100, Robert Pluim <rpluim@gmail.com> 
> >>>>> said:
>
> >>>>> On Tue, 21 Mar 2023 08:48:04 +0100, Robert Pluim <rpluim@gmail.com> 
> >>>>> said:
> >>>>> On Mon, 20 Mar 2023 17:34:22 +0000, João Távora <joaotavora@gmail.com> 
> >>>>> said:
>
>     João> _If_ I understand correctly, Robert, your run of
>     João> eglot-test-diagnostic-tags-unnecessary-code is failing
>     João> because of a face mismatch, presumably because only
>     João> clangd-11 is installed in your system, but if you install
>     João> a more recent clangd it goes away?  If so, yes, I think a
>     João> version check is appropriate, yes.
>
>     Robert> Yes. Version 11 fails, version 17 works, I donʼt know where the 
> cutoff
>     Robert> point is. Which version do you use?
>
>     Robert> So version 11 fails, version 13 fails, version 14 works, so I 
> guess >=
>     Robert> 14 should do the trick.
>
> João, would this be ok for you for master? (this test is currently
> failing on EMBA 😀)
>
> diff --git a/test/lisp/progmodes/eglot-tests.el 
> b/test/lisp/progmodes/eglot-tests.el
> index 7ac26732737..dfe969cf9f6 100644
> --- a/test/lisp/progmodes/eglot-tests.el
> +++ b/test/lisp/progmodes/eglot-tests.el
> @@ -452,6 +452,14 @@ eglot-test-basic-diagnostics
>  (ert-deftest eglot-test-diagnostic-tags-unnecessary-code ()
>    "Test rendering of diagnostics tagged \"unnecessary\"."
>    (skip-unless (executable-find "clangd"))
> +  (skip-unless (>=
> +                (string-to-number
> +                 (string-trim
> +                  (replace-regexp-in-string
> +                  "\\`.*version \\([0-9]+\\).*"
> +                  "\\1"
> +                  (shell-command-to-string "clangd --version"))))
> +                14))
>    (eglot--with-fixture
>        `(("diag-project" .
>           (("main.cpp" . "int main(){float a = 42.2; return 0;}"))))

Looks very verbose: why can't we use 'version<='?

And I think I'd rather make some eglot--clangd-version helper.

Another option is to skip this on EMBA completely.  I presume
there's an 'EMBA' environment variable there.  Don't use 'CI',
though, as GitHub actions also sets it and the test passes fine in that
CI server.

Another option is to install a newer clangd on EMBA, as 11 is
really quite old when compared to the newer versions.  Michael,
you installed clangd on EMBA.  What are the options to upgrade
an external program there?

João



reply via email to

[Prev in Thread] Current Thread [Next in Thread]