aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2025-09-18 14:56:05 +0200
committerMichael Albinus2025-09-18 14:56:05 +0200
commit979ddc06019cce249a9ada359b85f3cd4b6a0149 (patch)
treee53cebfca0aaff294fb6b71fd2034498f6456f8a /test
parentdd622e06e7db8362ecdb69ecbd42b2fb01a5168b (diff)
downloademacs-979ddc06019cce249a9ada359b85f3cd4b6a0149.tar.gz
emacs-979ddc06019cce249a9ada359b85f3cd4b6a0149.zip
Fix failed tests on emba
* test/lisp/autorevert-tests.el (auto-revert-test05-global-notify) (auto-revert-test07-auto-revert-several-buffers): Adapt tests. * test/src/comp-resources/comp-test-funcs.el (foo): Define error symbol.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/autorevert-tests.el39
-rw-r--r--test/src/comp-resources/comp-test-funcs.el2
2 files changed, 17 insertions, 24 deletions
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index ca38084b2b5..8f00996d584 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -572,7 +572,7 @@ Set modified file time in order to trigger auto-revert."
572 nil 'local)))) 572 nil 'local))))
573 573
574(ert-deftest auto-revert-test05-global-notify () 574(ert-deftest auto-revert-test05-global-notify ()
575 "Test `global-auto-revert-mode' without polling." 575 "Test `global-auto-revert-mode'."
576 (skip-unless (or file-notify--library 576 (skip-unless (or file-notify--library
577 (file-remote-p auto-revert--test-rootdir))) 577 (file-remote-p auto-revert--test-rootdir)))
578 578
@@ -584,7 +584,6 @@ Set modified file time in order to trigger auto-revert."
584 (ert-with-temp-file file-3 584 (ert-with-temp-file file-3
585 :prefix ert-temp-file-prefix 585 :prefix ert-temp-file-prefix
586 (let ((auto-revert-use-notify t) 586 (let ((auto-revert-use-notify t)
587 (auto-revert-avoid-polling t)
588 (was-in-global-auto-revert-mode global-auto-revert-mode) 587 (was-in-global-auto-revert-mode global-auto-revert-mode)
589 (file-2b (concat file-2 "-b")) 588 (file-2b (concat file-2 "-b"))
590 require-final-newline buf-1 buf-2 buf-3) 589 require-final-newline buf-1 buf-2 buf-3)
@@ -592,8 +591,12 @@ Set modified file time in order to trigger auto-revert."
592 (progn 591 (progn
593 (setq buf-1 (find-file-noselect file-1)) 592 (setq buf-1 (find-file-noselect file-1))
594 (auto-revert-test--instrument-kill-buffer-hook buf-1) 593 (auto-revert-test--instrument-kill-buffer-hook buf-1)
594 (should-not (buffer-local-value 'auto-revert-mode buf-1))
595 (should-not (buffer-local-value 'auto-revert--global-mode buf-1))
595 (setq buf-2 (find-file-noselect file-2)) 596 (setq buf-2 (find-file-noselect file-2))
596 (auto-revert-test--instrument-kill-buffer-hook buf-2) 597 (auto-revert-test--instrument-kill-buffer-hook buf-2)
598 (should-not (buffer-local-value 'auto-revert-mode buf-2))
599 (should-not (buffer-local-value 'auto-revert--global-mode buf-2))
597 ;; File stamps of remote files have an accuracy of 1 600 ;; File stamps of remote files have an accuracy of 1
598 ;; second. Wait a little bit. 601 ;; second. Wait a little bit.
599 (when (file-remote-p file-1) 602 (when (file-remote-p file-1)
@@ -604,6 +607,10 @@ Set modified file time in order to trigger auto-revert."
604 607
605 (global-auto-revert-mode 1) ; Turn it on. 608 (global-auto-revert-mode 1) ; Turn it on.
606 (auto-revert--skip-unless-proper-library-and-monitor buf-1) 609 (auto-revert--skip-unless-proper-library-and-monitor buf-1)
610 (should-not (buffer-local-value 'auto-revert-mode buf-1))
611 (should (buffer-local-value 'auto-revert--global-mode buf-1))
612 (should-not (buffer-local-value 'auto-revert-mode buf-2))
613 (should (buffer-local-value 'auto-revert--global-mode buf-2))
607 614
608 ;; buf-1 should have been reverted immediately when the mode 615 ;; buf-1 should have been reverted immediately when the mode
609 ;; was enabled. 616 ;; was enabled.
@@ -611,23 +618,17 @@ Set modified file time in order to trigger auto-revert."
611 (string-equal (auto-revert-test--buffer-string buf-1) "1-a")) 618 (string-equal (auto-revert-test--buffer-string buf-1) "1-a"))
612 619
613 ;; Alter a file. 620 ;; Alter a file.
614 (ert-with-message-capture auto-revert--messages 621 (auto-revert-test--write-region "2-a" file-2)
615 (auto-revert-test--write-region "2-a" file-2 buf-2) 622 (auto-revert-test--wait-for-buffer-text
616 (auto-revert--wait-for-revert buf-2)) 623 buf-2 "2-a" (auto-revert--timeout))
617 (should 624 (should
618 (string-equal (auto-revert-test--buffer-string buf-2) "2-a")) 625 (string-equal (auto-revert-test--buffer-string buf-2) "2-a"))
619 626
620 ;; Visit a file, and modify it on disk. 627 ;; Visit a file, and modify it on disk.
621 (setq buf-3 (find-file-noselect file-3)) 628 (setq buf-3 (find-file-noselect file-3))
622 (auto-revert-test--instrument-kill-buffer-hook buf-3) 629 (auto-revert-test--instrument-kill-buffer-hook buf-3)
623 ;; Newly opened buffers won't be use notification until the 630 (should-not (buffer-local-value 'auto-revert-mode buf-3))
624 ;; first poll cycle; wait for it. 631 (should (buffer-local-value 'auto-revert--global-mode buf-3))
625 (auto-revert-test--wait-for
626 (lambda () (buffer-local-value
627 'auto-revert-notify-watch-descriptor buf-3))
628 (auto-revert--timeout))
629 (should (buffer-local-value
630 'auto-revert-notify-watch-descriptor buf-3))
631 (auto-revert-test--write-region "3-a" file-3) 632 (auto-revert-test--write-region "3-a" file-3)
632 (auto-revert-test--wait-for-buffer-text 633 (auto-revert-test--wait-for-buffer-text
633 buf-3 "3-a" (auto-revert--timeout)) 634 buf-3 "3-a" (auto-revert--timeout))
@@ -644,8 +645,6 @@ Set modified file time in order to trigger auto-revert."
644 ;; while polling. So increase the timeout. 645 ;; while polling. So increase the timeout.
645 (auto-revert-test--wait-for-buffer-text 646 (auto-revert-test--wait-for-buffer-text
646 buf-1 "1-b" (* 2 (auto-revert--timeout))) 647 buf-1 "1-b" (* 2 (auto-revert--timeout)))
647 (should (buffer-local-value
648 'auto-revert-notify-watch-descriptor buf-1))
649 648
650 ;; Write a buffer to a new file, then modify the new 649 ;; Write a buffer to a new file, then modify the new
651 ;; file on disk. 650 ;; file on disk.
@@ -655,9 +654,7 @@ Set modified file time in order to trigger auto-revert."
655 (string-equal (auto-revert-test--buffer-string buf-2) "2-a")) 654 (string-equal (auto-revert-test--buffer-string buf-2) "2-a"))
656 (auto-revert-test--write-region "2-b" file-2b) 655 (auto-revert-test--write-region "2-b" file-2b)
657 (auto-revert-test--wait-for-buffer-text 656 (auto-revert-test--wait-for-buffer-text
658 buf-2 "2-b" (auto-revert--timeout)) 657 buf-2 "2-b" (auto-revert--timeout)))
659 (should (buffer-local-value
660 'auto-revert-notify-watch-descriptor buf-2)))
661 658
662 ;; Clean up. 659 ;; Clean up.
663 (unless was-in-global-auto-revert-mode 660 (unless was-in-global-auto-revert-mode
@@ -776,9 +773,6 @@ Set modified file time in order to trigger auto-revert."
776 (auto-revert-mode 0) 773 (auto-revert-mode 0)
777 (should-not auto-revert-mode)) 774 (should-not auto-revert-mode))
778 (with-current-buffer (car buffers) 775 (with-current-buffer (car buffers)
779 (should
780 (buffer-local-value
781 'auto-revert-notify-watch-descriptor (current-buffer)))
782 (should auto-revert-mode))) 776 (should auto-revert-mode)))
783 777
784 ;; Killing an indirect buffer does not disable autorevert in 778 ;; Killing an indirect buffer does not disable autorevert in
@@ -786,9 +780,6 @@ Set modified file time in order to trigger auto-revert."
786 (dolist (buf (cdr buffers)) 780 (dolist (buf (cdr buffers))
787 (kill-buffer buf)) 781 (kill-buffer buf))
788 (with-current-buffer (car buffers) 782 (with-current-buffer (car buffers)
789 (should
790 (buffer-local-value
791 'auto-revert-notify-watch-descriptor (current-buffer)))
792 (should auto-revert-mode))) 783 (should auto-revert-mode)))
793 784
794 ;; Exit. 785 ;; Exit.
diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el
index 5154b875499..04e3afe49fa 100644
--- a/test/src/comp-resources/comp-test-funcs.el
+++ b/test/src/comp-resources/comp-test-funcs.el
@@ -261,6 +261,8 @@
261(defun comp-tests-trampoline-removal-f () 261(defun comp-tests-trampoline-removal-f ()
262 (make-hash-table)) 262 (make-hash-table))
263 263
264(define-error 'foo "foo")
265
264(defun comp-tests-signal-f () 266(defun comp-tests-signal-f ()
265 (signal 'foo t)) 267 (signal 'foo t))
266 268