aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2023-03-15 00:36:26 +0000
committerJoão Távora2023-03-15 00:36:26 +0000
commita054c4aa4a5d42e7abe01f181a40a630f0df2b87 (patch)
tree8413ed93712776519c308c9756f4c4dac484faa8
parentcf7db4d9dd2e69cf7463a3d43ce7d92a6dce6f3c (diff)
downloademacs-a054c4aa4a5d42e7abe01f181a40a630f0df2b87.tar.gz
emacs-a054c4aa4a5d42e7abe01f181a40a630f0df2b87.zip
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.
-rw-r--r--test/lisp/progmodes/eglot-tests.el16
1 files changed, 10 insertions, 6 deletions
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."
281 do 281 do
282 ;; `read-event' is essential to have the file 282 ;; `read-event' is essential to have the file
283 ;; watchers come through. 283 ;; watchers come through.
284 (read-event nil nil 0.1) 284 (cond ((fboundp 'flush-standard-output)
285 (princ ".") (flush-standard-output) 285 (read-event nil nil 0.1) (princ ".")
286 (flush-standard-output))
287 (t
288 (read-event "." nil 0.1)))
286 (accept-process-output nil 0.1)))) 289 (accept-process-output nil 0.1))))
287 (setq ,events-sym (cdr events)) 290 (setq ,events-sym (cdr events))
288 (cl-destructuring-bind (&key method id &allow-other-keys) (car events) 291 (cl-destructuring-bind (&key method id &allow-other-keys) (car events)
@@ -441,7 +444,7 @@ then restored."
441 (eglot--find-file-noselect "diag-project/main.c") 444 (eglot--find-file-noselect "diag-project/main.c")
442 (eglot--sniffing (:server-notifications s-notifs) 445 (eglot--sniffing (:server-notifications s-notifs)
443 (eglot--tests-connect) 446 (eglot--tests-connect)
444 (eglot--wait-for (s-notifs 2) 447 (eglot--wait-for (s-notifs 10)
445 (&key _id method &allow-other-keys) 448 (&key _id method &allow-other-keys)
446 (string= method "textDocument/publishDiagnostics")) 449 (string= method "textDocument/publishDiagnostics"))
447 (flymake-start) 450 (flymake-start)
@@ -826,9 +829,10 @@ pylsp prefers autopep over yafp, despite its README stating the contrary."
826 (eglot--sniffing (:server-notifications s-notifs) 829 (eglot--sniffing (:server-notifications s-notifs)
827 (eglot--tests-connect) 830 (eglot--tests-connect)
828 (flymake-start) 831 (flymake-start)
829 (eglot--wait-for (s-notifs 10) 832 (eglot--wait-for (s-notifs 15)
830 (&key _id method &allow-other-keys) 833 (&key _id method params &allow-other-keys)
831 (string= method "textDocument/publishDiagnostics")) 834 (and (string= method "textDocument/publishDiagnostics")
835 (string-suffix-p "main.rs" (plist-get params :uri))))
832 (let* ((diags (flymake--project-diagnostics))) 836 (let* ((diags (flymake--project-diagnostics)))
833 (should (cl-some (lambda (diag) 837 (should (cl-some (lambda (diag)
834 (let ((locus (flymake-diagnostic-buffer diag))) 838 (let ((locus (flymake-diagnostic-buffer diag)))