From: João Távora Date: Wed, 15 Mar 2023 00:36:26 +0000 (+0000) Subject: More fixes to Eglot tests X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a054c4aa4a5d42e7abe01f181a40a630f0df2b87;p=emacs.git More fixes to Eglot tests * test/lisp/progmodes/eglot-tests.el (eglot-test-project-wide-diagnostics-rust-analyzer): Make even more robust. (eglot--wait-for): flush-standard-output doesn't exist in older Emacsen. (eglot-test-basic-diagnostics): Increase timeout. --- diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el index d5f0f02fc6b..b95e527c510 100644 --- a/test/lisp/progmodes/eglot-tests.el +++ b/test/lisp/progmodes/eglot-tests.el @@ -281,8 +281,11 @@ then restored." do ;; `read-event' is essential to have the file ;; watchers come through. - (read-event nil nil 0.1) - (princ ".") (flush-standard-output) + (cond ((fboundp 'flush-standard-output) + (read-event nil nil 0.1) (princ ".") + (flush-standard-output)) + (t + (read-event "." nil 0.1))) (accept-process-output nil 0.1)))) (setq ,events-sym (cdr events)) (cl-destructuring-bind (&key method id &allow-other-keys) (car events) @@ -441,7 +444,7 @@ then restored." (eglot--find-file-noselect "diag-project/main.c") (eglot--sniffing (:server-notifications s-notifs) (eglot--tests-connect) - (eglot--wait-for (s-notifs 2) + (eglot--wait-for (s-notifs 10) (&key _id method &allow-other-keys) (string= method "textDocument/publishDiagnostics")) (flymake-start) @@ -826,9 +829,10 @@ pylsp prefers autopep over yafp, despite its README stating the contrary." (eglot--sniffing (:server-notifications s-notifs) (eglot--tests-connect) (flymake-start) - (eglot--wait-for (s-notifs 10) - (&key _id method &allow-other-keys) - (string= method "textDocument/publishDiagnostics")) + (eglot--wait-for (s-notifs 15) + (&key _id method params &allow-other-keys) + (and (string= method "textDocument/publishDiagnostics") + (string-suffix-p "main.rs" (plist-get params :uri)))) (let* ((diags (flymake--project-diagnostics))) (should (cl-some (lambda (diag) (let ((locus (flymake-diagnostic-buffer diag)))